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: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master] pblimage: suppress stdout output
Date: Fri,  3 May 2024 12:08:56 +0200	[thread overview]
Message-ID: <20240503100856.1222507-1-a.fatoum@pengutronix.de> (raw)

Any output, stdout or stderr, during normal operation looks jarring when
interleaved with Kbuild, so utilities should just be always silent on
stdout and print errors to stderr if they occur.

The pblimage tool violated this and had a stdout debug print left-over and
printed part of an error message to stdout instead of stderr. Fix both
instances.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 scripts/pblimage.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/scripts/pblimage.c b/scripts/pblimage.c
index ef09b0f96084..610d93b36800 100644
--- a/scripts/pblimage.c
+++ b/scripts/pblimage.c
@@ -258,7 +258,6 @@ static void pbl_load_image(void)
 
 		read(in_fd, mem_buf + 0x1000, image_size);
 		pbl_size = 0x1000 + image_size;
-		printf("%s imagesize: %d\n", rcwfile, image_size);
 	} else {
 		exit(EXIT_FAILURE);
 	}
@@ -419,7 +418,7 @@ int main(int argc, char *argv[])
 	if (soc_type == SOC_TYPE_INVALID) {
 		fprintf(stderr, "Invalid CPU type %s. Valid types are:\n", cputypestr);
 		for (i = 0; i < ARRAY_SIZE(socs); i++)
-			printf("  %s\n", socs[i].name);
+			fprintf(stderr, "  %s\n", socs[i].name);
 
 		exit(EXIT_FAILURE);
 	}
-- 
2.39.2




             reply	other threads:[~2024-05-03 10:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03 10:08 Ahmad Fatoum [this message]
2024-05-06  6:16 ` 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=20240503100856.1222507-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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