Commit e14eec19 authored by Maximilian Attems's avatar Maximilian Attems Committed by Linus Torvalds

[PATCH] drivers/char/isicom.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 90cbc9b1
...@@ -389,7 +389,7 @@ static void isicom_tx(unsigned long _data) ...@@ -389,7 +389,7 @@ static void isicom_tx(unsigned long _data)
tty = port->tty; tty = port->tty;
save_flags(flags); cli(); save_flags(flags); cli();
txcount = MIN(TX_SIZE, port->xmit_cnt); txcount = min_t(short, TX_SIZE, port->xmit_cnt);
if ((txcount <= 0) || tty->stopped || tty->hw_stopped) { if ((txcount <= 0) || tty->stopped || tty->hw_stopped) {
restore_flags(flags); restore_flags(flags);
continue; continue;
...@@ -421,7 +421,7 @@ static void isicom_tx(unsigned long _data) ...@@ -421,7 +421,7 @@ static void isicom_tx(unsigned long _data)
residue = NO; residue = NO;
wrd = 0; wrd = 0;
while (1) { while (1) {
cnt = MIN(txcount, (SERIAL_XMIT_SIZE - port->xmit_tail)); cnt = min_t(int, txcount, (SERIAL_XMIT_SIZE - port->xmit_tail));
if (residue == YES) { if (residue == YES) {
residue = NO; residue = NO;
if (cnt > 0) { if (cnt > 0) {
...@@ -650,7 +650,7 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id, ...@@ -650,7 +650,7 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id,
} }
} }
else { /* Data Packet */ else { /* Data Packet */
count = MIN(byte_count, (TTY_FLIPBUF_SIZE - tty->flip.count)); count = min_t(unsigned short, byte_count, (TTY_FLIPBUF_SIZE - tty->flip.count));
#ifdef ISICOM_DEBUG #ifdef ISICOM_DEBUG
printk(KERN_DEBUG "ISICOM: Intr: Can rx %d of %d bytes.\n", printk(KERN_DEBUG "ISICOM: Intr: Can rx %d of %d bytes.\n",
count, byte_count); count, byte_count);
...@@ -1163,8 +1163,8 @@ static int isicom_write(struct tty_struct * tty, int from_user, ...@@ -1163,8 +1163,8 @@ static int isicom_write(struct tty_struct * tty, int from_user,
save_flags(flags); save_flags(flags);
while(1) { while(1) {
cli(); cli();
cnt = MIN(count, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1, cnt = min_t(int, count, min(SERIAL_XMIT_SIZE - port->xmit_cnt - 1,
SERIAL_XMIT_SIZE - port->xmit_head)); SERIAL_XMIT_SIZE - port->xmit_head));
if (cnt <= 0) if (cnt <= 0)
break; break;
...@@ -1180,8 +1180,8 @@ static int isicom_write(struct tty_struct * tty, int from_user, ...@@ -1180,8 +1180,8 @@ static int isicom_write(struct tty_struct * tty, int from_user,
return -EFAULT; return -EFAULT;
} }
cli(); cli();
cnt = MIN(cnt, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1, cnt = min_t(int, cnt, min(SERIAL_XMIT_SIZE - port->xmit_cnt - 1,
SERIAL_XMIT_SIZE - port->xmit_head)); SERIAL_XMIT_SIZE - port->xmit_head));
memcpy(port->xmit_buf + port->xmit_head, tmp_buf, cnt); memcpy(port->xmit_buf + port->xmit_head, tmp_buf, cnt);
} }
else else
......
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