]> git.hungrycats.org Git - linux/commitdiff
[PATCH] guard mad16 debug macro.
authorDave Jones <davej@codemonkey.org.uk>
Mon, 24 Mar 2003 04:51:33 +0000 (20:51 -0800)
committerDave Jones <davej@tetrachloride.(none)>
Mon, 24 Mar 2003 04:51:33 +0000 (20:51 -0800)
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
sound/oss/sound_config.h

index 8e3f124dea4fa3f6969a397c64f49d86147792d8..32e636b6a8bce812cf452c61bd3ca0092afa1e31 100644 (file)
@@ -99,7 +99,7 @@ static int    debug = 0;      /* debugging output */
 #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 @@ static int __init detect_mad16(void)
        }
        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)
index 4838b589cf6e56a0479a0f69ae750a8b3aa22e2d..9f912b8a29698aad52a5f63292afb4c393ef5142 100644 (file)
@@ -137,7 +137,7 @@ static inline int translate_mode(struct file *file)
 #endif
 
 #ifndef DDB
-#define DDB(x) {}
+#define DDB(x) do {} while (0)
 #endif
 
 #ifndef MDB