Skip to content

Commit 2474798

Browse files
tobluxopsiff
authored andcommitted
printk: add print_hex_dump_devel()
[ Upstream commit d134feeb5df33fbf77f482f52a366a44642dba09 ] Add print_hex_dump_devel() as the hex dump equivalent of pr_devel(), which emits output only when DEBUG is enabled, but keeps call sites compiled otherwise. Suggested-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Reviewed-by: John Ogness <john.ogness@linutronix.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Stable-dep-of: 177730a273b1 ("crypto: caam - guard HMAC key hex dumps in hash_digest_key") Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit f3a3e2dac5ec66c714e87520ffa463b4363c9215) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent 0d3688d commit 2474798

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

include/linux/printk.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,19 @@ static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type,
746746
}
747747
#endif
748748

749+
#if defined(DEBUG)
750+
#define print_hex_dump_devel(prefix_str, prefix_type, rowsize, \
751+
groupsize, buf, len, ascii) \
752+
print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize, \
753+
groupsize, buf, len, ascii)
754+
#else
755+
static inline void print_hex_dump_devel(const char *prefix_str, int prefix_type,
756+
int rowsize, int groupsize,
757+
const void *buf, size_t len, bool ascii)
758+
{
759+
}
760+
#endif
761+
749762
/**
750763
* print_hex_dump_bytes - shorthand form of print_hex_dump() with default params
751764
* @prefix_str: string to prefix each line with;

0 commit comments

Comments
 (0)