2002-11-03 11:41:37

by Denis Vlasenko

[permalink] [raw]
Subject: [PATCH] drivers/net/smc9194.h: add do {...} while(0) as appropriate

diff -u --recursive linux-2.5.40org/drivers/net/smc9194.h linux-2.5.40/drivers/net/smc9194.h
--- linux-2.5.40org/drivers/net/smc9194.h Tue Oct 1 05:07:46 2002
+++ linux-2.5.40/drivers/net/smc9194.h Wed Oct 9 08:17:59 2002
@@ -201,31 +201,32 @@

/* select a register bank, 0 to 3 */

-#define SMC_SELECT_BANK(x) { outw( x, ioaddr + BANK_SELECT ); }
+#define SMC_SELECT_BANK(x) outw( x, ioaddr + BANK_SELECT )

/* define a small delay for the reset */
-#define SMC_DELAY() { inw( ioaddr + RCR );\
- inw( ioaddr + RCR );\
- inw( ioaddr + RCR ); }
+#define SMC_DELAY() do { inw( ioaddr + RCR );\
+ inw( ioaddr + RCR );\
+ inw( ioaddr + RCR );\
+} while(0)

/* this enables an interrupt in the interrupt mask register */
-#define SMC_ENABLE_INT(x) {\
+#define SMC_ENABLE_INT(x) do {\
unsigned char mask;\
SMC_SELECT_BANK(2);\
mask = inb( ioaddr + INT_MASK );\
mask |= (x);\
- outb( mask, ioaddr + INT_MASK ); \
-}
+ outb( mask, ioaddr + INT_MASK );\
+} while(0)

/* this disables an interrupt from the interrupt mask register */

-#define SMC_DISABLE_INT(x) {\
+#define SMC_DISABLE_INT(x) do {\
unsigned char mask;\
SMC_SELECT_BANK(2);\
mask = inb( ioaddr + INT_MASK );\
mask &= ~(x);\
- outb( mask, ioaddr + INT_MASK ); \
-}
+ outb( mask, ioaddr + INT_MASK );\
+} while(0)

/*----------------------------------------------------------------------
. Define the interrupts that I want to receive from the card