All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: sbabic@denx.de
Cc: uboot-imx@nxp.com, u-boot@lists.denx.de,
	Eduard Strehlau <eduard@lionizers.com>,
	Fabio Estevam <festevam@denx.de>
Subject: [PATCH 1/3] imx: hab: Allow hab_auth_img_or_fail to be called without ivt_offset
Date: Wed,  6 Sep 2023 22:47:25 -0300	[thread overview]
Message-ID: <20230907014727.371324-1-festevam@gmail.com> (raw)

From: Eduard Strehlau <eduard@lionizers.com>

Since commit ea91031b2232 ("imx: hab: extend hab_auth_img to calculate
ivt_offset"), it is possible to call the hab_auth_img command without the 
last ivt_offset argument.

Currently, calling hab_auth_img_or_fail without the last
ivt_offset parameter causes a failure and the command usage text is shown.

Fix this problem by adjusting the argc logic to allow
calling hab_auth_img_or_fail with only the address and size parameters.

This way, both hab_auth_img and hab_auth_img_or_fail have the same
behavior with respect to the allowed number of command parameters.
 
Signed-off-by: Eduard Strehlau <eduard@lionizers.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
 arch/arm/mach-imx/hab.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/hab.c b/arch/arm/mach-imx/hab.c
index 439cdaf07a7c..6cacca069d9f 100644
--- a/arch/arm/mach-imx/hab.c
+++ b/arch/arm/mach-imx/hab.c
@@ -659,7 +659,7 @@ static int do_authenticate_image_or_failover(struct cmd_tbl *cmdtp, int flag,
 {
 	int ret = CMD_RET_FAILURE;
 
-	if (argc != 4) {
+	if (argc < 3) {
 		ret = CMD_RET_USAGE;
 		goto error;
 	}
-- 
2.34.1



             reply	other threads:[~2023-09-07  1:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-07  1:47 Fabio Estevam [this message]
2023-09-07  1:47 ` [PATCH 2/3] imx: hab: Improve the hab_auth_img_or_fail usage text Fabio Estevam
2023-09-23 18:51   ` sbabic
2023-09-07  1:47 ` [PATCH 3/3] imx: hab: Explain that ivt_offset is optional Fabio Estevam
2023-09-23 18:52   ` sbabic
2023-09-23 18:51 ` [PATCH 1/3] imx: hab: Allow hab_auth_img_or_fail to be called without ivt_offset sbabic

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=20230907014727.371324-1-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=eduard@lionizers.com \
    --cc=festevam@denx.de \
    --cc=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.