diff options
author | Joe Perches <joe@perches.com> | 2009-12-14 21:00:14 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-15 11:53:25 -0500 |
commit | 00b55864bb37200d7f05143c44f5e2edfc8c4578 (patch) | |
tree | e744e54d7422559c3504724dfc85d678bc2996cf /include/linux/dynamic_debug.h | |
parent | 42f247c83aeb52d2ee7a9fe23fb57e22317f18fd (diff) |
dynamic_debug.h/kernel.h: Remove KBUILD_MODNAME from dynamic_pr_debug
If CONFIG_DYNAMIC_DEBUG is enabled and a source file has:
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
dynamic_debug.h will duplicate KBUILD_MODNAME
in the output string.
Remove the use of KBUILD_MODNAME from the
output format string generated by dynamic_debug.h
If CONFIG_DYNAMIC_DEBUG is not enabled, no compile-time
check is done to printk/dev_printk arguments.
Add it.
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Jason Baron <jbaron@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/dynamic_debug.h')
-rw-r--r-- | include/linux/dynamic_debug.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index a0d9422a1569..f8c2e1767500 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h | |||
@@ -57,8 +57,7 @@ extern int ddebug_remove_module(char *mod_name); | |||
57 | { KBUILD_MODNAME, __func__, __FILE__, fmt, DEBUG_HASH, \ | 57 | { KBUILD_MODNAME, __func__, __FILE__, fmt, DEBUG_HASH, \ |
58 | DEBUG_HASH2, __LINE__, _DPRINTK_FLAGS_DEFAULT }; \ | 58 | DEBUG_HASH2, __LINE__, _DPRINTK_FLAGS_DEFAULT }; \ |
59 | if (__dynamic_dbg_enabled(descriptor)) \ | 59 | if (__dynamic_dbg_enabled(descriptor)) \ |
60 | printk(KERN_DEBUG KBUILD_MODNAME ":" pr_fmt(fmt), \ | 60 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \ |
61 | ##__VA_ARGS__); \ | ||
62 | } while (0) | 61 | } while (0) |
63 | 62 | ||
64 | 63 | ||
@@ -69,9 +68,7 @@ extern int ddebug_remove_module(char *mod_name); | |||
69 | { KBUILD_MODNAME, __func__, __FILE__, fmt, DEBUG_HASH, \ | 68 | { KBUILD_MODNAME, __func__, __FILE__, fmt, DEBUG_HASH, \ |
70 | DEBUG_HASH2, __LINE__, _DPRINTK_FLAGS_DEFAULT }; \ | 69 | DEBUG_HASH2, __LINE__, _DPRINTK_FLAGS_DEFAULT }; \ |
71 | if (__dynamic_dbg_enabled(descriptor)) \ | 70 | if (__dynamic_dbg_enabled(descriptor)) \ |
72 | dev_printk(KERN_DEBUG, dev, \ | 71 | dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \ |
73 | KBUILD_MODNAME ": " fmt, \ | ||
74 | ##__VA_ARGS__); \ | ||
75 | } while (0) | 72 | } while (0) |
76 | 73 | ||
77 | #else | 74 | #else |
@@ -81,8 +78,10 @@ static inline int ddebug_remove_module(char *mod) | |||
81 | return 0; | 78 | return 0; |
82 | } | 79 | } |
83 | 80 | ||
84 | #define dynamic_pr_debug(fmt, ...) do { } while (0) | 81 | #define dynamic_pr_debug(fmt, ...) \ |
85 | #define dynamic_dev_dbg(dev, format, ...) do { } while (0) | 82 | do { if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); } while (0) |
83 | #define dynamic_dev_dbg(dev, format, ...) \ | ||
84 | do { if (0) dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); } while (0) | ||
86 | #endif | 85 | #endif |
87 | 86 | ||
88 | #endif | 87 | #endif |