summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2015-09-09 15:37:11 -0700
committerStefan Agner <stefan.agner@toradex.com>2016-11-25 18:41:15 -0800
commite037ce178922b5187bfbf848de4d0d449590e9bc (patch)
treea41c835fea4b8cc2217ea1b7671546418aebbb69
parent204bcdf40d856bb91cfeeebdbd5f6181cf012ba0 (diff)
hexdump: do not print debug dumps for !CONFIG_DEBUG
print_hex_dump_debug() is likely supposed to be analogous to pr_debug() or dev_dbg() & friends. Currently it will adhere to dynamic debug, but will not stub out prints if CONFIG_DEBUG is not set. Let's make it do the right thing, because I am tired of having my dmesg buffer full of hex dumps on production systems. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> (cherry picked from commit cdf17449af1d9b596742c260134edd6c1fac2792)
-rw-r--r--include/linux/printk.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 9b30871c9149..d90b82e97820 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -454,11 +454,17 @@ static inline void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
groupsize, buf, len, ascii) \
dynamic_hex_dump(prefix_str, prefix_type, rowsize, \
groupsize, buf, len, ascii)
-#else
+#elif defined(DEBUG)
#define print_hex_dump_debug(prefix_str, prefix_type, rowsize, \
groupsize, buf, len, ascii) \
print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize, \
groupsize, buf, len, ascii)
-#endif /* defined(CONFIG_DYNAMIC_DEBUG) */
+#else
+static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type,
+ int rowsize, int groupsize,
+ const void *buf, size_t len, bool ascii)
+{
+}
+#endif
#endif