mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: mtr@pengutronix.de, Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 3/3] fixup! commands: implement rksecure command
Date: Wed,  7 Jan 2026 13:57:59 +0100	[thread overview]
Message-ID: <20260107125800.3947255-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20260107125800.3947255-1-a.fatoum@pengutronix.de>

commands: rksecure: use printf for command errors

pr_err is logged, may be shared with Linux via pstore and outputs to stderr,
which may point at a different console or be hidden by log level setting.

printf on the other hand is not logged, uses stdout and is thus the
correct function to use to output, regular or error, in commands.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 commands/rksecure.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/commands/rksecure.c b/commands/rksecure.c
index e0c20f75fcec..81b4f1a62860 100644
--- a/commands/rksecure.c
+++ b/commands/rksecure.c
@@ -17,14 +17,14 @@ static int rksecure_write_hash_hex(const char *hex, u32 key_size_bits)
 	u8 digest[SHA256_DIGEST_SIZE];
 
 	if (strlen(hex) != SHA256_DIGEST_SIZE * 2) {
-		pr_err("%s has wrong size: Expected %d characters\n",
+		printf("%s has wrong size: Expected %d characters\n",
 		       hex, SHA256_DIGEST_SIZE * 2);
 		return -EINVAL;
 	}
 
 	ret = hex2bin(digest, hex, SHA256_DIGEST_SIZE);
 	if (ret < 0) {
-		pr_err("Failed to parse hash %s\n", hex);
+		printf("Failed to parse hash %s\n", hex);
 		return -EINVAL;
 	}
 
@@ -41,7 +41,7 @@ static int rksecure_write_hash_file(const char *filename, u32 key_size_bits)
 	if (ret)
 		return ret;
 	if (size != SHA256_DIGEST_SIZE) {
-		pr_err("%s has wrong size: Expected %d bytes\n",
+		printf("%s has wrong size: Expected %d bytes\n",
 		       filename, SHA256_DIGEST_SIZE);
 		return -EINVAL;
 	}
@@ -60,7 +60,7 @@ static int rksecure_print_info(void)
 
 	ret = rk_secure_boot_get_info(&info);
 	if (ret) {
-		pr_err("Failed to read secure boot info\n");
+		printf("Failed to read secure boot info\n");
 		return ret;
 	}
 
-- 
2.47.3




  parent reply	other threads:[~2026-01-07 12:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-07 12:57 [PATCH 1/3] fixup! tee: drivers: add driver for Rockchip Secure Boot PTA Ahmad Fatoum
2026-01-07 12:57 ` [PATCH 2/3] fixup! commands: implement rksecure command Ahmad Fatoum
2026-01-07 12:57 ` Ahmad Fatoum [this message]
2026-01-07 13:05 ` [PATCH 1/3] fixup! tee: drivers: add driver for Rockchip Secure Boot PTA Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260107125800.3947255-3-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=mtr@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox