summaryrefslogtreecommitdiff
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2008-12-04 16:55:47 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2009-01-06 10:44:33 -0800
commitd0d85ff989222f08dd1fa66321fef5567bbc4a7b (patch)
tree77af68b3dcd51d95c231025dcb3e4dd3bd21b285 /include/linux/kernel.h
parentb9daa99ee533578e3f88231e7a16784dcb44ec42 (diff)
downloadlwn-d0d85ff989222f08dd1fa66321fef5567bbc4a7b.tar.gz
lwn-d0d85ff989222f08dd1fa66321fef5567bbc4a7b.zip
Make DEBUG take precedence over DYNAMIC_PRINTK_DEBUG
Statically defined DEBUG should take precedence over dynamically enabled debugging; otherwise adding DEBUG (like, for example, via CONFIG_DEBUG_KOBJECT) does not have the expected result of printing pr_debug() and dev_dbg() messages unconditionally. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Acked-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index ca9ff6411dfa..d242fe1381fd 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -349,13 +349,13 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
/* If you are writing a driver, please use dev_dbg instead */
-#if defined(CONFIG_DYNAMIC_PRINTK_DEBUG)
+#if defined(DEBUG)
+#define pr_debug(fmt, ...) \
+ printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+#elif defined(CONFIG_DYNAMIC_PRINTK_DEBUG)
#define pr_debug(fmt, ...) do { \
dynamic_pr_debug(pr_fmt(fmt), ##__VA_ARGS__); \
} while (0)
-#elif defined(DEBUG)
-#define pr_debug(fmt, ...) \
- printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
#else
#define pr_debug(fmt, ...) \
({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; })