Procházet zdrojové kódy

[MTD] MTD_DEBUG always does compile-time typechecks

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>
David Brownell před 17 roky
rodič
revize
95b1bc2053
1 změnil soubory, kde provedl 5 přidání a 1 odebrání
  1. 5 1
      include/linux/mtd/mtd.h

+ 5 - 1
include/linux/mtd/mtd.h

@@ -272,7 +272,11 @@ static inline void mtd_erase_callback(struct erase_info *instr)
 			printk(KERN_INFO args);		\
 			printk(KERN_INFO args);		\
 	} while(0)
 	} while(0)
 #else /* CONFIG_MTD_DEBUG */
 #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 */
 #endif /* CONFIG_MTD_DEBUG */