[PATCH] lib/hexdump: print_hex_dump_bytes() calls print_hex_dump_debug()

Geert Uytterhoeven posted 1 patch 18 hours ago
include/linux/printk.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
[PATCH] lib/hexdump: print_hex_dump_bytes() calls print_hex_dump_debug()
Posted by Geert Uytterhoeven 18 hours ago
print_hex_dump_bytes() claims to be a simple wrapper around
print_hex_dump(), but it actally calls print_hex_dump_debug(), which
means no output is printed if (dynamic) DEBUG is disabled.

Update the documentation to match the implementation.

Fixes: 091cb0994edd20d6 ("lib/hexdump: make print_hex_dump_bytes() a nop on !DEBUG builds")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
I added a print_hex_dump_bytes() call, and wondered where my hexdump
went...
---
 include/linux/printk.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/linux/printk.h b/include/linux/printk.h
index 63d516c873b4c412..1a33b813808cabde 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -802,7 +802,8 @@ static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type,
 #endif
 
 /**
- * print_hex_dump_bytes - shorthand form of print_hex_dump() with default params
+ * print_hex_dump_bytes - shorthand form of print_hex_dump_debug() with default
+ *                        params
  * @prefix_str: string to prefix each line with;
  *  caller supplies trailing spaces for alignment if desired
  * @prefix_type: controls whether prefix of an offset, address, or none
@@ -810,7 +811,7 @@ static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type,
  * @buf: data blob to dump
  * @len: number of bytes in the @buf
  *
- * Calls print_hex_dump(), with log level of KERN_DEBUG,
+ * Calls print_hex_dump_debug(), with log level of KERN_DEBUG,
  * rowsize of 16, groupsize of 1, and ASCII output included.
  */
 #define print_hex_dump_bytes(prefix_str, prefix_type, buf, len)	\
-- 
2.43.0
Re: [PATCH] lib/hexdump: print_hex_dump_bytes() calls print_hex_dump_debug()
Posted by Petr Mladek 30 minutes ago
On Tue 2026-03-31 17:21:43, Geert Uytterhoeven wrote:
> print_hex_dump_bytes() claims to be a simple wrapper around
> print_hex_dump(), but it actally calls print_hex_dump_debug(), which
> means no output is printed if (dynamic) DEBUG is disabled.
> 
> Update the documentation to match the implementation.
> 
> Fixes: 091cb0994edd20d6 ("lib/hexdump: make print_hex_dump_bytes() a nop on !DEBUG builds")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Great catch!

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr