public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Stefan Roese <sr@denx.de>, Michal Simek <michal.simek@amd.com>,
	Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de
Subject: [PATCH 4/4] cmd: mvebu/bubt: Fix cmd main return value on error
Date: Tue, 26 Jul 2022 16:11:59 +0200	[thread overview]
Message-ID: <20220726141159.19774-5-pali@kernel.org> (raw)
In-Reply-To: <20220726141159.19774-1-pali@kernel.org>

Negative return value from cmd main function cause U-Boot to print criplic
error message: exit not allowed from main input shell.

Set return value on error to 1.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 cmd/mvebu/bubt.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c
index 276069a0efc2..ffa05bc20181 100644
--- a/cmd/mvebu/bubt.c
+++ b/cmd/mvebu/bubt.c
@@ -870,11 +870,11 @@ int do_bubt_cmd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 	dst = find_bubt_dev(dst_dev_name);
 	if (!dst) {
 		printf("Error: Unknown destination \"%s\"\n", dst_dev_name);
-		return -EINVAL;
+		return 1;
 	}
 
 	if (!bubt_is_dev_active(dst))
-		return -ENODEV;
+		return 1;
 
 	/* Figure out the source device */
 	src = find_bubt_dev(src_dev_name);
@@ -891,15 +891,15 @@ int do_bubt_cmd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 
 	image_size = bubt_read_file(src);
 	if (!image_size)
-		return -EIO;
+		return 1;
 
 	err = bubt_verify(dst);
 	if (err)
-		return err;
+		return 1;
 
 	err = bubt_write_file(dst, image_size);
 	if (err)
-		return err;
+		return 1;
 
 	return 0;
 }
-- 
2.20.1


  parent reply	other threads:[~2022-07-26 14:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26 14:11 [PATCH 0/4] cmd: mvebu/bubt: Improvements for image verification Pali Rohár
2022-07-26 14:11 ` [PATCH 1/4] cmd: mvebu/bubt: Verify image type for all 32-bit Aramda SoCs and Armada 3700 Pali Rohár
2022-07-28  6:36   ` Stefan Roese
2022-07-26 14:11 ` [PATCH 2/4] cmd: mvebu/bubt: Correctly propagate failure during tftp transport Pali Rohár
2022-07-28  6:37   ` Stefan Roese
2022-07-26 14:11 ` [PATCH 3/4] cmd: mvebu/bubt: Add support for sha512 checksum validation for Armada 3700 Pali Rohár
2022-07-28  6:37   ` Stefan Roese
2022-07-26 14:11 ` Pali Rohár [this message]
2022-07-28  6:38   ` [PATCH 4/4] cmd: mvebu/bubt: Fix cmd main return value on error Stefan Roese
2022-07-29 12:02 ` [PATCH 0/4] cmd: mvebu/bubt: Improvements for image verification Stefan Roese

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=20220726141159.19774-5-pali@kernel.org \
    --to=pali@kernel.org \
    --cc=michal.simek@amd.com \
    --cc=sjg@chromium.org \
    --cc=sr@denx.de \
    --cc=u-boot@lists.denx.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