mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* guard mad16 debug macro.
@ 2003-03-24 20:45 davej
  0 siblings, 0 replies; only message in thread
From: davej @ 2003-03-24 20:45 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

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 <joe@perches.com>

--- sound/oss/mad16.c.old	2003-03-24 09:31:49.000000000 -0800
+++ sound/oss/mad16.c	2003-03-24 09:39:14.000000000 -0800
@@ -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)
--- sound/oss/sound_config.h.old	2003-02-17 14:55:56.000000000 -0800
+++ sound/oss/sound_config.h	2003-03-24 09:36:09.000000000 -0800
@@ -137,7 +137,7 @@
 #endif
 
 #ifndef DDB
-#define DDB(x) {}
+#define DDB(x) do {} while (0)
 #endif
 
 #ifndef MDB



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-03-24 20:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-24 20:45 guard mad16 debug macro davej

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®