From: Linus Walleij Date: Wed, 9 Sep 2015 22:37:11 +0000 (-0700) Subject: hexdump: do not print debug dumps for !CONFIG_DEBUG X-Git-Tag: v4.3-rc1~22^2~55 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=cdf17449af1d;p=linux.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/printk.h b/include/linux/printk.h index 6545d911054f..9729565c25ff 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -456,11 +456,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