drivers/char/isicom.c MIN/MAX removal
PATCH 4/25 drivers/char/isicom.c MIN/MAX removal
Patch (against 2.6.7) removes unnecessary min/max macros and changes calls to use kernel.h macros instead.
Feedback is always welcome
Michael
Signed-off-by Maximilian Attems <[email protected]>
---
linux-2.6.9-rc1-bk7-max/drivers/char/isicom.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)
drivers/char/isicom.c renamed from drivers/char/isicom.c~min-max-char_isicom +7 -7
@@ -389,7 +389,7 @@ static void isicom_tx(unsigned long _dat tty = port->tty;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) {restore_flags (flags);continue ;
@@ -421,7 +421,7 @@ static void isicom_tx(unsigned long _dat residue =NO ; wrd =0 ;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 ) { residue =NO ;if (cnt >0 ) {
@@ -650,7 +650,7 @@ static irqreturn_t isicom_interrupt(int } }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 printk (KERN_DEBUG "ISICOM: Intr: Can rx %d of %d bytes.\n" , count, byte_count);
@@ -1163,8 +1163,8 @@ static int isicom_write(struct tty_strucsave_flags (flags);while (1 ) {cli (); - cnt =MIN (count,MIN (SERIAL_XMIT_SIZE - port->xmit_cnt -1 , -SERIAL_XMIT_SIZE - port->xmit_head)); + cnt =min_t (int, count,min (SERIAL_XMIT_SIZE - port->xmit_cnt -1 , +SERIAL_XMIT_SIZE - port->xmit_head));if (cnt <=0 )break ;
@@ -1180,8 +1180,8 @@ static int isicom_write(struct tty_strucreturn -EFAULT ; }cli (); - cnt =MIN (cnt,MIN (SERIAL_XMIT_SIZE - port->xmit_cnt -1 , -SERIAL_XMIT_SIZE - port->xmit_head)); + cnt =min_t (int, cnt,min (SERIAL_XMIT_SIZE - port->xmit_cnt -1 , +SERIAL_XMIT_SIZE - port->xmit_head));memcpy (port->xmit_buf + port->xmit_head, tmp_buf, cnt); }else
_