Skip to contentSkip to conversation

guard mad16 debug macro.

PATCH [email protected] 1 participant 1 message Mar 24, 2003

lore
Share & tools
lore
#0 lore raw

Still pretty ugly debug macro, but this at least makes it do the right thing when used in if/else blocks

Fix from Joe Perches <[email protected]>

oss/mad16.c renamed from oss/mad16.c.old +3 -2
@@ -99,7 +99,7 @@
 #ifdef DDB
 #undef DDB
 #endif
-#define DDB(x) {if (debug) x;}
+#define DDB(x) do {if (debug) x;} while (0)
 
 static unsigned char mad_read(int port)
 {
@@ -278,7 +278,8 @@
 	}
 	for (i = 0xf8d; i <= 0xf98; i++)
 		if (!c924pnp)
-			DDB(printk("Port %0x (init value) = %0x\n", i, mad_read(i))) else
+			DDB(printk("Port %0x (init value) = %0x\n", i, mad_read(i)));
+		else
 			DDB(printk("Port %0x (init value) = %0x\n", i-0x80, mad_read(i)));
 
 	if (board_type == C930)
oss/sound_config.h renamed from oss/sound_config.h.old +1 -1
@@ -137,7 +137,7 @@
 #endif
 
 #ifndef DDB
-#define DDB(x) {}
+#define DDB(x) do {} while (0)
 #endif
 
 #ifndef MDB