]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] better debug macro safety
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 26 May 2003 09:57:52 +0000 (02:57 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Mon, 26 May 2003 09:57:52 +0000 (02:57 -0700)
From:  Rusty Russell <rusty@rustcorp.com.au>

  I don't think it's misused anywhere, but it's better to be safe.

  Pointed out by Joern Engel.

include/linux/mtd/mtd.h

index 503a715fe0148c36d5bfa1ee32b2e1cb062914c3..6a57af9f46a3f52bf7f9b310439bca51ccf85ddb 100644 (file)
@@ -260,10 +260,11 @@ extern int unregister_mtd_user (struct mtd_notifier *old);
 #define MTD_DEBUG_LEVEL3       (3)     /* Noisy   */
 
 #ifdef CONFIG_MTD_DEBUG
-#define DEBUG(n, args...)                      \
-       if (n <=  CONFIG_MTD_DEBUG_VERBOSE) {   \
-               printk(KERN_INFO args); \
-       }
+#define DEBUG(n, args...)                              \
+       do {                                            \
+               if (n <= CONFIG_MTD_DEBUG_VERBOSE)      \
+                       printk(KERN_INFO args);         \
+       } while(0)
 #else /* CONFIG_MTD_DEBUG */
 #define DEBUG(n, args...)
 #endif /* CONFIG_MTD_DEBUG */