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] boot: don't print error message on -ENOMEDIUM
Date: Mon, 12 Jun 2023 15:03:22 +0200	[thread overview]
Message-ID: <20230612130322.1093717-1-a.fatoum@pengutronix.de> (raw)

It can be expected for a boot entry to usually fail, e.g. when it checks
for a removable USB drive that's not always connected. Such boot targets
have the choice of either returning 0, which means it was a dry run and
boot aborts or an error code, which yields an error message.

Let's handle -ENOMEDIUM specially and not print an error for it, so it
can be used in such scenarios.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/boot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/boot.c b/common/boot.c
index 9c6fc3044271..4edea682219b 100644
--- a/common/boot.c
+++ b/common/boot.c
@@ -151,7 +151,7 @@ int boot_entry(struct bootentry *be, int verbose, int dryrun)
 	}
 
 	ret = be->boot(be, verbose, dryrun);
-	if (ret)
+	if (ret && ret != -ENOMEDIUM)
 		pr_err("Booting entry '%s' failed\n", be->title);
 
 	return ret;
-- 
2.39.2




             reply	other threads:[~2023-06-12 13:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12 13:03 Ahmad Fatoum [this message]
2023-06-13  7:14 ` 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=20230612130322.1093717-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