Skip to content

Commit cdf1744

Browse files
Linus Walleijtorvalds
authored andcommitted
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>
1 parent 9bf98f1 commit cdf1744

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

include/linux/printk.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,17 @@ static inline void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
456456
groupsize, buf, len, ascii) \
457457
dynamic_hex_dump(prefix_str, prefix_type, rowsize, \
458458
groupsize, buf, len, ascii)
459-
#else
459+
#elif defined(DEBUG)
460460
#define print_hex_dump_debug(prefix_str, prefix_type, rowsize, \
461461
groupsize, buf, len, ascii) \
462462
print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize, \
463463
groupsize, buf, len, ascii)
464-
#endif /* defined(CONFIG_DYNAMIC_DEBUG) */
464+
#else
465+
static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type,
466+
int rowsize, int groupsize,
467+
const void *buf, size_t len, bool ascii)
468+
{
469+
}
470+
#endif
465471

466472
#endif

0 commit comments

Comments
 (0)