Skip to contentSkip to conversation

drivers/sbus/char/ minmax removal and

PATCH In review Michael Veeck 2 participants 2 messages Jul 12, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/sbus/char/ minmax removal and

This patch (against 2.6.8-rc1) removes minmax-macros and changes calls to use kernel.h macros instead.

Now heres the problem: Since all that is left on my minmax-todolist are arch-specific-files, is there a way to cross-compile the kernel image so that I can at least test if the patches compile? Sort of like "compile everything there is, even if its hardware that wont ever exist on my plattform" ?

Best regards
Veeck

drivers/sbus/char/aurora.c +7 -11
diff -uprN -X dontdiff linux-2.6.8-rc1-old/drivers/sbus/char/aurora.c linux-2.6.8-rc1-new/drivers/sbus/char/aurora.c
@@ -81,10 +81,6 @@ unsigned char irqs[4] = {
 int irqhit=0;
 #endif
 
-#ifndef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
-
 static struct tty_driver *aurora_driver;
 static struct Aurora_board aurora_board[AURORA_NBOARD] = {
 	{0,},
@@ -594,7 +590,7 @@ static void aurora_transmit(struct Auror
 					    &bp->r[chip]->r[CD180_TDR]);
 				port->COR2 &= ~COR2_ETC;
 			}
-			count = MIN(port->break_length, 0xff);
+			count = min_t(unsigned char, port->break_length, 0xff);
 			sbus_writeb(CD180_C_ESC,
 				    &bp->r[chip]->r[CD180_TDR]);
 			sbus_writeb(CD180_C_DELAY,
@@ -1577,8 +1573,8 @@ static int aurora_write(struct tty_struc
 	if (from_user) {
 		down(&tmp_buf_sem);
 		while (1) {
-			c = MIN(count, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1,
-					   SERIAL_XMIT_SIZE - port->xmit_head));
+			c = min_t(int, count, min(SERIAL_XMIT_SIZE - port->xmit_cnt - 1,
+						  SERIAL_XMIT_SIZE - port->xmit_head));
 			if (c <= 0)
 				break;
 
@@ -1589,8 +1585,8 @@ static int aurora_write(struct tty_struc
 				break;
 			}
 			cli();
-			c = MIN(c, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1,
-				       SERIAL_XMIT_SIZE - port->xmit_head));
+			c = min_t(int, c, min(SERIAL_XMIT_SIZE - port->xmit_cnt - 1,
+					      SERIAL_XMIT_SIZE - port->xmit_head));
 			memcpy(port->xmit_buf + port->xmit_head, tmp_buf, c);
 			port->xmit_head = (port->xmit_head + c) & (SERIAL_XMIT_SIZE-1);
 			port->xmit_cnt += c;
@@ -1604,8 +1600,8 @@ static int aurora_write(struct tty_struc
 	} else {
 		while (1) {
 			cli();
-			c = MIN(count, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1,
-					   SERIAL_XMIT_SIZE - port->xmit_head));
+			c = min_t(int, count, min(SERIAL_XMIT_SIZE - port->xmit_cnt - 1,
+						  SERIAL_XMIT_SIZE - port->xmit_head));
 			if (c <= 0) {
 				restore_flags(flags);
 				break;

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw

Hi Michael,

On Mon, Jul 12, 2004 at 05:38:36PM +0200, Michael Veeck told us:

Quoted 8 lines

This patch (against 2.6.8-rc1) removes minmax-macros and changes calls to use kernel.h macros instead.

Now heres the problem: Since all that is left on my minmax-todolist are arch-specific-files, is there a way to cross-compile the kernel image so that I can at least test if the patches compile? Sort of like "compile everything there is, even if its hardware that wont ever exist on my plattform" ?

maybe

make menuconfig ARCH=insert_needed_arch_here
make ARCH=insert_needed_arch_here

???

HTH

Sven

Quoted 5 lines

Best regards
Veeck

Signature · 2 lines
Linux zion 2.6.8-rc1 #1 Sun Jul 11 23:36:03 CEST 2004 i686 athlon i386 GNU/Linux
 18:24:27  up 18:42,  1 user,  load average: 0.03, 0.03, 0.00

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors