Skip to content

Commit f3a3e2d

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 43a8786 commit f3a3e2d

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
@@ -745,6 +745,19 @@ static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type,
745745
}
746746
#endif
747747

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

0 commit comments

Comments
 (0)