Skip to content

Commit f8324c9

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 a52e122 commit f8324c9

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
@@ -801,6 +801,19 @@ static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type,
801801
}
802802
#endif
803803

804+
#if defined(DEBUG)
805+
#define print_hex_dump_devel(prefix_str, prefix_type, rowsize, \
806+
groupsize, buf, len, ascii) \
807+
print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize, \
808+
groupsize, buf, len, ascii)
809+
#else
810+
static inline void print_hex_dump_devel(const char *prefix_str, int prefix_type,
811+
int rowsize, int groupsize,
812+
const void *buf, size_t len, bool ascii)
813+
{
814+
}
815+
#endif
816+
804817
/**
805818
* print_hex_dump_bytes - shorthand form of print_hex_dump() with default params
806819
* @prefix_str: string to prefix each line with;

0 commit comments

Comments
 (0)