From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 625BF345757 for ; Sun, 10 May 2026 15:10:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778425813; cv=none; b=LWvVSNxN72v/OuHgxUV7btQEp2UJEcr6ubvvsuVPT7+f8bE/BQH7bqyUGR7BDSiX9V1NXi+2EMU9k8MF0S34LENND/Bb6551y8NeMQbqw6e0fUchZdYSCidxnyC2kbXmId8JPvJvsRkU3k13+OuzqzqddXlwZ2DxABrtcl2OMZU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778425813; c=relaxed/simple; bh=32FOrgedyudNbnxnMMnaVZ2M11hviWjdsiDrzPc0hAM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rXEiferRjq0DgqjD1NmPSB/ZkN556VnrAmhs1+QjJ9O7vwfEBEZvNFGqaAn12yFGhdt6UlkQSIANF1kcZkOZIGUM7TH+bZvhaP5DpFaw4UdW7vQft/365mWp7vMWNZRgmgPC1u7f1ajh/z/VAjdMNs+qFKL7jiWzzALzQ1vxhyM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WvpLAKd5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WvpLAKd5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FC19C2BCB8; Sun, 10 May 2026 15:10:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778425813; bh=32FOrgedyudNbnxnMMnaVZ2M11hviWjdsiDrzPc0hAM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WvpLAKd5Qq/ckrfr5gjgUqcHCGBP+rh5/5n4+06YLA3S32X69tFrzUgDfpa7+2cSd 7pHadovTauEpV5QLtHM4NgWU4iRnvD0vKK/AcraKAQtzPw2U7ocUZpEqf5pXkpRLBP GX68K76M4iMx1lWGQ0LrlW6d7hKmuK825x9iVHe7CyWvmQ7espcMOD+EPZfy8u1DR4 xKiHTprPYJ7d8v4oOGFjsIVi5kTpxvqTyU2xSHFeQQ7wOuWUrY/ZU/GZx6zvERxcQC WHjRqJEpPBTrxo1PAfaRUUkaE9+RWPdLgRcFp1DV6RFqeZn7kH+q8ZfMyveU3XgTfQ bROPR1bL1pzQQ== From: Sasha Levin To: stable@vger.kernel.org Cc: Thorsten Blum , Herbert Xu , John Ogness , Sasha Levin Subject: [PATCH 5.15.y 1/2] printk: add print_hex_dump_devel() Date: Sun, 10 May 2026 11:10:09 -0400 Message-ID: <20260510151010.38344-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026050438-landline-earthworm-2d1c@gregkh> References: <2026050438-landline-earthworm-2d1c@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Thorsten Blum [ 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 Signed-off-by: Thorsten Blum Reviewed-by: John Ogness Signed-off-by: Herbert Xu Stable-dep-of: 177730a273b1 ("crypto: caam - guard HMAC key hex dumps in hash_digest_key") Signed-off-by: Sasha Levin --- include/linux/printk.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/linux/printk.h b/include/linux/printk.h index c4fb84822111d..fe7f2fdbbe34f 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -740,6 +740,19 @@ static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type, } #endif +#if defined(DEBUG) +#define print_hex_dump_devel(prefix_str, prefix_type, rowsize, \ + groupsize, buf, len, ascii) \ + print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize, \ + groupsize, buf, len, ascii) +#else +static inline void print_hex_dump_devel(const char *prefix_str, int prefix_type, + int rowsize, int groupsize, + const void *buf, size_t len, bool ascii) +{ +} +#endif + /** * print_hex_dump_bytes - shorthand form of print_hex_dump() with default params * @prefix_str: string to prefix each line with; -- 2.53.0