]> err.no Git - linux-2.6/commitdiff
[MTD] MTD_DEBUG always does compile-time typechecks
authorDavid Brownell <dbrownell@users.sourceforge.net>
Wed, 30 Jul 2008 05:28:12 +0000 (22:28 -0700)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 30 Jul 2008 13:21:05 +0000 (14:21 +0100)
The current style for debug messages is to ensure they're always
parsed by the compiler and then subjected to dead code removal.
That way builds won't break only when debug options get enabled,
which is common when they are stripped out early by CPP.

This patch makes CONFIG_MTD_DEBUG adopt that convention.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
include/linux/mtd/mtd.h

index 4ed40caff4e58161a8e5d545421e375d0b81f7e2..922636548558943d7af9007074cb8d2e7e91fcb0 100644 (file)
@@ -272,7 +272,11 @@ static inline void mtd_erase_callback(struct erase_info *instr)
                        printk(KERN_INFO args);         \
        } while(0)
 #else /* CONFIG_MTD_DEBUG */
-#define DEBUG(n, args...) do { } while(0)
+#define DEBUG(n, args...)                              \
+       do {                                            \
+               if (0)                                  \
+                       printk(KERN_INFO args);         \
+       } while(0)
 
 #endif /* CONFIG_MTD_DEBUG */