Skip to content

Commit 95b1bc2

Browse files
David BrownellDavid Woodhouse
authored andcommitted
[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>
1 parent 771999b commit 95b1bc2

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎include/linux/mtd/mtd.h‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,11 @@ static inline void mtd_erase_callback(struct erase_info *instr)
272272
printk(KERN_INFO args); \
273273
} while(0)
274274
#else /* CONFIG_MTD_DEBUG */
275-
#define DEBUG(n, args...) do { } while(0)
275+
#define DEBUG(n, args...) \
276+
do { \
277+
if (0) \
278+
printk(KERN_INFO args); \
279+
} while(0)
276280

277281
#endif /* CONFIG_MTD_DEBUG */
278282

0 commit comments

Comments
 (0)