Skip to content

Commit

Permalink
[MTD] MTD_DEBUG always does compile-time typechecks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Brownell authored and David Woodhouse committed Jul 30, 2008
1 parent 771999b commit 95b1bc2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/linux/mtd/mtd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down

0 comments on commit 95b1bc2

Please sign in to comment.