aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZach Brown <zach.brown@oracle.com>2006-10-03 04:16:15 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 11:04:20 -0400
commit8b2a1fd1b394c60eaa2587716102dd5e9b4e5990 (patch)
tree6317cd01c2a758908f747f2c0b110dd40b9dc6d9
parent3879b6b6a8ee39b50559b2c2dd083c557d39e0f8 (diff)
[PATCH] pr_debug: check pr_debug() arguments
check pr_debug() arguments When DEBUG isn't defined pr_debug() is defined away as an empty macro. By throwing away the arguments we allow completely incorrect code to build. Instead let's make it an empty inline which checks arguments and mark it so gcc can check the format specification. This results in a seemingly insignificant code size increase. A x86-64 allyesconfig: text data bss dec hex filename 25354768 7191098 4854720 37400586 23ab00a vmlinux.before 25354945 7191138 4854720 37400803 23ab0e3 vmlinux Signed-off-by: Zach Brown <zach.brown@oracle.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--include/linux/kernel.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 4d00988dad03..80f39cab470a 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -216,8 +216,10 @@ extern void dump_stack(void);
216#define pr_debug(fmt,arg...) \ 216#define pr_debug(fmt,arg...) \
217 printk(KERN_DEBUG fmt,##arg) 217 printk(KERN_DEBUG fmt,##arg)
218#else 218#else
219#define pr_debug(fmt,arg...) \ 219static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char * fmt, ...)
220 do { } while (0) 220{
221 return 0;
222}
221#endif 223#endif
222 224
223#define pr_info(fmt,arg...) \ 225#define pr_info(fmt,arg...) \