* [Kernel-janitors] [PATCH] drivers/char/isicom.c MIN/MAX removal
@ 2004-07-03 15:05 Michael Veeck
0 siblings, 0 replies; only message in thread
From: Michael Veeck @ 2004-07-03 15:05 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 150 bytes --]
Patch (against 2.6.7) removes unnecessary min/max macros and changes
calls to use kernel.h macros instead.
Feedback is always welcome
Michael
[-- Attachment #2: patch-char-isicom --]
[-- Type: text/plain, Size: 1688 bytes --]
--- linux-2.6.7-old/drivers/char/isicom.c 2004-07-04 11:04:14.000000000 +0200
+++ linux-2.6.7-new/drivers/char/isicom.c 2004-07-04 16:24:01.332090464 +0200
@@ -388,7 +388,7 @@
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;
@@ -420,7 +420,7 @@
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) {
@@ -649,7 +649,7 @@
}
}
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);
@@ -1162,8 +1162,8 @@
save_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;
@@ -1179,8 +1179,8 @@
return -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
[-- Attachment #3: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-07-03 15:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-03 15:05 [Kernel-janitors] [PATCH] drivers/char/isicom.c MIN/MAX removal Michael Veeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.