public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] cmd: ubifs: Do not show usage when command fails
@ 2022-08-07 19:58 Pali Rohár
  2022-10-09 11:18 ` Pali Rohár
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Pali Rohár @ 2022-08-07 19:58 UTC (permalink / raw)
  To: u-boot

Return value -1 cause U-Boot to print usage message. Return value
1 (CMD_RET_FAILURE) indicates failure. So fix return value when ubifs
command starts it execution and fails.

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

diff --git a/cmd/ubifs.c b/cmd/ubifs.c
index 7a620c5e21da..6a01d0988a2d 100644
--- a/cmd/ubifs.c
+++ b/cmd/ubifs.c
@@ -33,7 +33,7 @@ int cmd_ubifs_mount(char *vol_name)
 
 	ret = uboot_ubifs_mount(vol_name);
 	if (ret)
-		return -1;
+		return CMD_RET_FAILURE;
 
 	ubifs_mounted = 1;
 
@@ -62,7 +62,7 @@ int cmd_ubifs_umount(void)
 {
 	if (ubifs_initialized == 0) {
 		printf("No UBIFS volume mounted!\n");
-		return -1;
+		return CMD_RET_FAILURE;
 	}
 
 	uboot_ubifs_umount();
@@ -89,7 +89,7 @@ static int do_ubifs_ls(struct cmd_tbl *cmdtp, int flag, int argc,
 
 	if (!ubifs_mounted) {
 		printf("UBIFS not mounted, use ubifsmount to mount volume first!\n");
-		return -1;
+		return CMD_RET_FAILURE;
 	}
 
 	if (argc == 2)
@@ -116,7 +116,7 @@ static int do_ubifs_load(struct cmd_tbl *cmdtp, int flag, int argc,
 
 	if (!ubifs_mounted) {
 		printf("UBIFS not mounted, use ubifs mount to mount volume first!\n");
-		return -1;
+		return CMD_RET_FAILURE;
 	}
 
 	if (argc < 3)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] cmd: ubifs: Do not show usage when command fails
  2022-08-07 19:58 [PATCH] cmd: ubifs: Do not show usage when command fails Pali Rohár
@ 2022-10-09 11:18 ` Pali Rohár
  2022-11-01 22:20   ` Pali Rohár
  2022-11-01 23:25 ` Simon Glass
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Pali Rohár @ 2022-10-09 11:18 UTC (permalink / raw)
  To: u-boot

PING?

On Sunday 07 August 2022 21:58:56 Pali Rohár wrote:
> Return value -1 cause U-Boot to print usage message. Return value
> 1 (CMD_RET_FAILURE) indicates failure. So fix return value when ubifs
> command starts it execution and fails.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>
> ---
>  cmd/ubifs.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/cmd/ubifs.c b/cmd/ubifs.c
> index 7a620c5e21da..6a01d0988a2d 100644
> --- a/cmd/ubifs.c
> +++ b/cmd/ubifs.c
> @@ -33,7 +33,7 @@ int cmd_ubifs_mount(char *vol_name)
>  
>  	ret = uboot_ubifs_mount(vol_name);
>  	if (ret)
> -		return -1;
> +		return CMD_RET_FAILURE;
>  
>  	ubifs_mounted = 1;
>  
> @@ -62,7 +62,7 @@ int cmd_ubifs_umount(void)
>  {
>  	if (ubifs_initialized == 0) {
>  		printf("No UBIFS volume mounted!\n");
> -		return -1;
> +		return CMD_RET_FAILURE;
>  	}
>  
>  	uboot_ubifs_umount();
> @@ -89,7 +89,7 @@ static int do_ubifs_ls(struct cmd_tbl *cmdtp, int flag, int argc,
>  
>  	if (!ubifs_mounted) {
>  		printf("UBIFS not mounted, use ubifsmount to mount volume first!\n");
> -		return -1;
> +		return CMD_RET_FAILURE;
>  	}
>  
>  	if (argc == 2)
> @@ -116,7 +116,7 @@ static int do_ubifs_load(struct cmd_tbl *cmdtp, int flag, int argc,
>  
>  	if (!ubifs_mounted) {
>  		printf("UBIFS not mounted, use ubifs mount to mount volume first!\n");
> -		return -1;
> +		return CMD_RET_FAILURE;
>  	}
>  
>  	if (argc < 3)
> -- 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] cmd: ubifs: Do not show usage when command fails
  2022-10-09 11:18 ` Pali Rohár
@ 2022-11-01 22:20   ` Pali Rohár
  2022-11-21 17:37     ` Pali Rohár
  0 siblings, 1 reply; 7+ messages in thread
From: Pali Rohár @ 2022-11-01 22:20 UTC (permalink / raw)
  To: u-boot

ping?

On Sunday 09 October 2022 13:18:47 Pali Rohár wrote:
> PING?
> 
> On Sunday 07 August 2022 21:58:56 Pali Rohár wrote:
> > Return value -1 cause U-Boot to print usage message. Return value
> > 1 (CMD_RET_FAILURE) indicates failure. So fix return value when ubifs
> > command starts it execution and fails.
> > 
> > Signed-off-by: Pali Rohár <pali@kernel.org>
> > ---
> >  cmd/ubifs.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/cmd/ubifs.c b/cmd/ubifs.c
> > index 7a620c5e21da..6a01d0988a2d 100644
> > --- a/cmd/ubifs.c
> > +++ b/cmd/ubifs.c
> > @@ -33,7 +33,7 @@ int cmd_ubifs_mount(char *vol_name)
> >  
> >  	ret = uboot_ubifs_mount(vol_name);
> >  	if (ret)
> > -		return -1;
> > +		return CMD_RET_FAILURE;
> >  
> >  	ubifs_mounted = 1;
> >  
> > @@ -62,7 +62,7 @@ int cmd_ubifs_umount(void)
> >  {
> >  	if (ubifs_initialized == 0) {
> >  		printf("No UBIFS volume mounted!\n");
> > -		return -1;
> > +		return CMD_RET_FAILURE;
> >  	}
> >  
> >  	uboot_ubifs_umount();
> > @@ -89,7 +89,7 @@ static int do_ubifs_ls(struct cmd_tbl *cmdtp, int flag, int argc,
> >  
> >  	if (!ubifs_mounted) {
> >  		printf("UBIFS not mounted, use ubifsmount to mount volume first!\n");
> > -		return -1;
> > +		return CMD_RET_FAILURE;
> >  	}
> >  
> >  	if (argc == 2)
> > @@ -116,7 +116,7 @@ static int do_ubifs_load(struct cmd_tbl *cmdtp, int flag, int argc,
> >  
> >  	if (!ubifs_mounted) {
> >  		printf("UBIFS not mounted, use ubifs mount to mount volume first!\n");
> > -		return -1;
> > +		return CMD_RET_FAILURE;
> >  	}
> >  
> >  	if (argc < 3)
> > -- 
> > 2.20.1
> > 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] cmd: ubifs: Do not show usage when command fails
  2022-08-07 19:58 [PATCH] cmd: ubifs: Do not show usage when command fails Pali Rohár
  2022-10-09 11:18 ` Pali Rohár
@ 2022-11-01 23:25 ` Simon Glass
  2022-11-03 12:20 ` Dhruva Gole
  2022-11-24 21:32 ` Tom Rini
  3 siblings, 0 replies; 7+ messages in thread
From: Simon Glass @ 2022-11-01 23:25 UTC (permalink / raw)
  To: Pali Rohár; +Cc: u-boot

On Sun, 7 Aug 2022 at 13:59, Pali Rohár <pali@kernel.org> wrote:
>
> Return value -1 cause U-Boot to print usage message. Return value
> 1 (CMD_RET_FAILURE) indicates failure. So fix return value when ubifs
> command starts it execution and fails.
>
> Signed-off-by: Pali Rohár <pali@kernel.org>
> ---
>  cmd/ubifs.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] cmd: ubifs: Do not show usage when command fails
  2022-08-07 19:58 [PATCH] cmd: ubifs: Do not show usage when command fails Pali Rohár
  2022-10-09 11:18 ` Pali Rohár
  2022-11-01 23:25 ` Simon Glass
@ 2022-11-03 12:20 ` Dhruva Gole
  2022-11-24 21:32 ` Tom Rini
  3 siblings, 0 replies; 7+ messages in thread
From: Dhruva Gole @ 2022-11-03 12:20 UTC (permalink / raw)
  To: u-boot



On 08/08/22 01:28, Pali Rohár wrote:
> Return value -1 cause U-Boot to print usage message. Return value
> 1 (CMD_RET_FAILURE) indicates failure. So fix return value when ubifs
> command starts it execution and fails.
>
> Signed-off-by: Pali Rohár <pali@kernel.org>

[...]

Reviewed-by: Dhruva Gole <d-gole@ti.com>

-- 
Best regards,
Dhruva Gole
Texas Instruments Incorporated


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] cmd: ubifs: Do not show usage when command fails
  2022-11-01 22:20   ` Pali Rohár
@ 2022-11-21 17:37     ` Pali Rohár
  0 siblings, 0 replies; 7+ messages in thread
From: Pali Rohár @ 2022-11-21 17:37 UTC (permalink / raw)
  To: Tom Rini, u-boot

+ Tom

On Tuesday 01 November 2022 23:20:15 Pali Rohár wrote:
> ping?
> 
> On Sunday 09 October 2022 13:18:47 Pali Rohár wrote:
> > PING?
> > 
> > On Sunday 07 August 2022 21:58:56 Pali Rohár wrote:
> > > Return value -1 cause U-Boot to print usage message. Return value
> > > 1 (CMD_RET_FAILURE) indicates failure. So fix return value when ubifs
> > > command starts it execution and fails.
> > > 
> > > Signed-off-by: Pali Rohár <pali@kernel.org>
> > > ---
> > >  cmd/ubifs.c | 8 ++++----
> > >  1 file changed, 4 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/cmd/ubifs.c b/cmd/ubifs.c
> > > index 7a620c5e21da..6a01d0988a2d 100644
> > > --- a/cmd/ubifs.c
> > > +++ b/cmd/ubifs.c
> > > @@ -33,7 +33,7 @@ int cmd_ubifs_mount(char *vol_name)
> > >  
> > >  	ret = uboot_ubifs_mount(vol_name);
> > >  	if (ret)
> > > -		return -1;
> > > +		return CMD_RET_FAILURE;
> > >  
> > >  	ubifs_mounted = 1;
> > >  
> > > @@ -62,7 +62,7 @@ int cmd_ubifs_umount(void)
> > >  {
> > >  	if (ubifs_initialized == 0) {
> > >  		printf("No UBIFS volume mounted!\n");
> > > -		return -1;
> > > +		return CMD_RET_FAILURE;
> > >  	}
> > >  
> > >  	uboot_ubifs_umount();
> > > @@ -89,7 +89,7 @@ static int do_ubifs_ls(struct cmd_tbl *cmdtp, int flag, int argc,
> > >  
> > >  	if (!ubifs_mounted) {
> > >  		printf("UBIFS not mounted, use ubifsmount to mount volume first!\n");
> > > -		return -1;
> > > +		return CMD_RET_FAILURE;
> > >  	}
> > >  
> > >  	if (argc == 2)
> > > @@ -116,7 +116,7 @@ static int do_ubifs_load(struct cmd_tbl *cmdtp, int flag, int argc,
> > >  
> > >  	if (!ubifs_mounted) {
> > >  		printf("UBIFS not mounted, use ubifs mount to mount volume first!\n");
> > > -		return -1;
> > > +		return CMD_RET_FAILURE;
> > >  	}
> > >  
> > >  	if (argc < 3)
> > > -- 
> > > 2.20.1
> > > 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] cmd: ubifs: Do not show usage when command fails
  2022-08-07 19:58 [PATCH] cmd: ubifs: Do not show usage when command fails Pali Rohár
                   ` (2 preceding siblings ...)
  2022-11-03 12:20 ` Dhruva Gole
@ 2022-11-24 21:32 ` Tom Rini
  3 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2022-11-24 21:32 UTC (permalink / raw)
  To: Pali Rohár; +Cc: u-boot

[-- Attachment #1: Type: text/plain, Size: 438 bytes --]

On Sun, Aug 07, 2022 at 09:58:56PM +0200, Pali Rohár wrote:

> Return value -1 cause U-Boot to print usage message. Return value
> 1 (CMD_RET_FAILURE) indicates failure. So fix return value when ubifs
> command starts it execution and fails.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Dhruva Gole <d-gole@ti.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-11-24 21:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-07 19:58 [PATCH] cmd: ubifs: Do not show usage when command fails Pali Rohár
2022-10-09 11:18 ` Pali Rohár
2022-11-01 22:20   ` Pali Rohár
2022-11-21 17:37     ` Pali Rohár
2022-11-01 23:25 ` Simon Glass
2022-11-03 12:20 ` Dhruva Gole
2022-11-24 21:32 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox