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 6CDB433EC for ; Sun, 10 May 2026 02:34:45 +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=1778380485; cv=none; b=MMyKUNGpBQwon0YWS+uj/t4+hbYIIrRjg6f8gd00YawK2kYHMp/q5ZYfwTBNGUZJzBuxRFsbydE5jLkXaobqurwdzimA3p3dtb0ir5vNS2lPH8q8JO1OyxzikpErzitvG264tRW8Zfnss3qoYVzaszEPW49PSYhPuP7c1O0xz7o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778380485; c=relaxed/simple; bh=1lUiU0FdBrH4VDFLn1ljyj6g7MEBYlPZ8Cr2WgPmH8g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZepoUrwZ0iYw6IPq1qB9sozwYMSkRE60hdLVmlnkhpa+fUgABSF1jnu12AH/7eIscoYdJKYKP1GZJH4rmgnSOwTjmb1of6F8bbMNh0ZwSAmI6nX0+ajVU1mfkXYklLC+PnBERvK9Tdi0mk7JDk6aDWP0ppUxSD9fUQ+Ud/tglT8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=u1TFpSRc; 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="u1TFpSRc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62884C2BCB2; Sun, 10 May 2026 02:34:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778380485; bh=1lUiU0FdBrH4VDFLn1ljyj6g7MEBYlPZ8Cr2WgPmH8g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u1TFpSRcvowlL3x8VaP9In4bvQGvYWtIwmJLf/5m1Fo88u4EqRY+pR6paSudJsgOl GNLs1w+HDWafyS0NCZMQvIKHuhUlRYgk6mAFJdr4THEJqI8BRnfQdpe89BMbHe+Vqa KdKN3M/IiDmQAgp2dMbBKuRdFcb2qYy3OThgtZ1X9vsjS+ITs/Oa5IHqhRPBC70V8t 9XcPMYq6CdnWELCoUdrJSQs1IGQAo5OARicdtMgYC3p2+2jgpRjAf/vH4l15N5vD6+ rYIOt+cPctTQHk2uMwh+UYjl1JbwPxeYHO/gjXgVQ1sw0Y0ymoHd+45CmeVfj97HQy wKXX3yq7zUMFg== From: Sasha Levin To: stable@vger.kernel.org Cc: Thorsten Blum , Herbert Xu , John Ogness , Sasha Levin Subject: [PATCH 6.12.y 1/2] printk: add print_hex_dump_devel() Date: Sat, 9 May 2026 22:34:41 -0400 Message-ID: <20260510023442.3940261-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026050436-flier-macaroni-9c3a@gregkh> References: <2026050436-flier-macaroni-9c3a@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 0cb647ecd77f5..f9498e9cb8ba4 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -786,6 +786,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