Commit e6e66b02 authored by Greg Banks's avatar Greg Banks Committed by Greg Kroah-Hartman

Dynamic debug: fix pr_fmt() build error

When CONFIG_DYNAMIC_DEBUG is enabled, allow callers of pr_debug()
to provide their own definition of pr_fmt() even if that definition
uses tricks like

#define pr_fmt(fmt) "%s:" fmt, __func__
Signed-off-by: default avatarGreg Banks <gnb@sgi.com>
Cc: Jason Baron <jbaron@redhat.com>
Acked-by: default avatarGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9898abb3
...@@ -57,7 +57,7 @@ extern int ddebug_remove_module(char *mod_name); ...@@ -57,7 +57,7 @@ extern int ddebug_remove_module(char *mod_name);
{ KBUILD_MODNAME, __func__, __FILE__, fmt, DEBUG_HASH, \ { KBUILD_MODNAME, __func__, __FILE__, fmt, DEBUG_HASH, \
DEBUG_HASH2, __LINE__, _DPRINTK_FLAGS_DEFAULT }; \ DEBUG_HASH2, __LINE__, _DPRINTK_FLAGS_DEFAULT }; \
if (__dynamic_dbg_enabled(descriptor)) \ if (__dynamic_dbg_enabled(descriptor)) \
printk(KERN_DEBUG KBUILD_MODNAME ":" fmt, \ printk(KERN_DEBUG KBUILD_MODNAME ":" pr_fmt(fmt), \
##__VA_ARGS__); \ ##__VA_ARGS__); \
} while (0) } while (0)
...@@ -70,7 +70,7 @@ extern int ddebug_remove_module(char *mod_name); ...@@ -70,7 +70,7 @@ extern int ddebug_remove_module(char *mod_name);
DEBUG_HASH2, __LINE__, _DPRINTK_FLAGS_DEFAULT }; \ DEBUG_HASH2, __LINE__, _DPRINTK_FLAGS_DEFAULT }; \
if (__dynamic_dbg_enabled(descriptor)) \ if (__dynamic_dbg_enabled(descriptor)) \
dev_printk(KERN_DEBUG, dev, \ dev_printk(KERN_DEBUG, dev, \
KBUILD_MODNAME ": " fmt, \ KBUILD_MODNAME ": " pr_fmt(fmt),\
##__VA_ARGS__); \ ##__VA_ARGS__); \
} while (0) } while (0)
......
...@@ -359,8 +359,9 @@ static inline char *pack_hex_byte(char *buf, u8 byte) ...@@ -359,8 +359,9 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
#define pr_debug(fmt, ...) \ #define pr_debug(fmt, ...) \
printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
#elif defined(CONFIG_DYNAMIC_DEBUG) #elif defined(CONFIG_DYNAMIC_DEBUG)
/* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */
#define pr_debug(fmt, ...) do { \ #define pr_debug(fmt, ...) do { \
dynamic_pr_debug(pr_fmt(fmt), ##__VA_ARGS__); \ dynamic_pr_debug(fmt, ##__VA_ARGS__); \
} while (0) } while (0)
#else #else
#define pr_debug(fmt, ...) \ #define pr_debug(fmt, ...) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment