Commit 7542ddc2 authored by Maximilian Attems's avatar Maximilian Attems Committed by Linus Torvalds

[PATCH] drivers/char/mxser.c MIN/MAX removal

Signed-off-by: default avatarMaximilian Attems <janitor@sternwelten.at>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e14eec19
...@@ -101,10 +101,6 @@ ...@@ -101,10 +101,6 @@
#define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? SA_SHIRQ : SA_INTERRUPT) #define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? SA_SHIRQ : SA_INTERRUPT)
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
/* /*
* Define the Moxa PCI vendor and device IDs. * Define the Moxa PCI vendor and device IDs.
*/ */
...@@ -849,7 +845,7 @@ static int mxser_write(struct tty_struct *tty, int from_user, ...@@ -849,7 +845,7 @@ static int mxser_write(struct tty_struct *tty, int from_user,
if (from_user) { if (from_user) {
down(&mxvar_tmp_buf_sem); down(&mxvar_tmp_buf_sem);
while (1) { while (1) {
c = MIN(count, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1, c = min_t(int, count, min(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
SERIAL_XMIT_SIZE - info->xmit_head)); SERIAL_XMIT_SIZE - info->xmit_head));
if (c <= 0) if (c <= 0)
break; break;
...@@ -862,7 +858,7 @@ static int mxser_write(struct tty_struct *tty, int from_user, ...@@ -862,7 +858,7 @@ static int mxser_write(struct tty_struct *tty, int from_user,
} }
cli(); cli();
c = MIN(c, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1, c = min_t(int, c, min(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
SERIAL_XMIT_SIZE - info->xmit_head)); SERIAL_XMIT_SIZE - info->xmit_head));
memcpy(info->xmit_buf + info->xmit_head, mxvar_tmp_buf, c); memcpy(info->xmit_buf + info->xmit_head, mxvar_tmp_buf, c);
info->xmit_head = (info->xmit_head + c) & (SERIAL_XMIT_SIZE - 1); info->xmit_head = (info->xmit_head + c) & (SERIAL_XMIT_SIZE - 1);
...@@ -877,7 +873,7 @@ static int mxser_write(struct tty_struct *tty, int from_user, ...@@ -877,7 +873,7 @@ static int mxser_write(struct tty_struct *tty, int from_user,
} else { } else {
while (1) { while (1) {
cli(); cli();
c = MIN(count, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1, c = min_t(int, count, min(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
SERIAL_XMIT_SIZE - info->xmit_head)); SERIAL_XMIT_SIZE - info->xmit_head));
if (c <= 0) { if (c <= 0) {
restore_flags(flags); restore_flags(flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment