[MTD] MTD_DEBUG always does compile-time typechecks

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Wed Jul 30 10:59:01 EDT 2008


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=95b1bc20532c18e3f19cd460c8350350c84ffbb2
Commit:     95b1bc20532c18e3f19cd460c8350350c84ffbb2
Parent:     771999b65f79264acde4b855e5d35696eca5e80c
Author:     David Brownell <dbrownell at users.sourceforge.net>
AuthorDate: Tue Jul 29 22:28:12 2008 -0700
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Wed Jul 30 14:21:05 2008 +0100

    [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 at users.sourceforge.net>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 include/linux/mtd/mtd.h |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 4ed40ca..9226365 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -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 */
 



More information about the linux-mtd-cvs mailing list