Skip to content

Commit 2fbf190

Browse files
tobluxgregkh
authored andcommitted
printk: add print_hex_dump_devel()
[ Upstream commit d134fee ] 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: 177730a ("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>
1 parent 0e550ca commit 2fbf190

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
@@ -786,6 +786,19 @@ static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type,
786786
}
787787
#endif
788788

789+
#if defined(DEBUG)
790+
#define print_hex_dump_devel(prefix_str, prefix_type, rowsize, \
791+
groupsize, buf, len, ascii) \
792+
print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize, \
793+
groupsize, buf, len, ascii)
794+
#else
795+
static inline void print_hex_dump_devel(const char *prefix_str, int prefix_type,
796+
int rowsize, int groupsize,
797+
const void *buf, size_t len, bool ascii)
798+
{
799+
}
800+
#endif
801+
789802
/**
790803
* print_hex_dump_bytes - shorthand form of print_hex_dump() with default params
791804
* @prefix_str: string to prefix each line with;

0 commit comments

Comments
 (0)