All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCHv2 0/3] Use return value of cmd_usage
@ 2010-11-25  7:05 Thomas Weber
  2010-11-25  7:05 ` [U-Boot] [PATCHv2 1/3] common/cmd_nvedit: " Thomas Weber
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Thomas Weber @ 2010-11-25  7:05 UTC (permalink / raw)
  To: u-boot

cmd_usage returns 1, so its return value can be used as return value.

Some functions ignore the return value of cmd_usage and return a "1" in
the next line. These patches change these calls so that the return value of
cmd_usage is used as return value.


*** BLURB HERE ***

Thomas Weber (3):
  Common/cmd_nvedit: Use return value of cmd_usage
  Gdsys: osd: Use return value of cmd_usage
  Powerpc: cmd_ecctest: Use return value of cmd_usage

 arch/powerpc/cpu/ppc4xx/cmd_ecctest.c |    6 ++----
 board/gdsys/common/osd.c              |    6 ++----
 common/cmd_nvedit.c                   |   18 ++++++------------
 3 files changed, 10 insertions(+), 20 deletions(-)

-- 
1.7.3.2

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

* [U-Boot] [PATCHv2 1/3] common/cmd_nvedit: Use return value of cmd_usage
  2010-11-25  7:05 [U-Boot] [PATCHv2 0/3] Use return value of cmd_usage Thomas Weber
@ 2010-11-25  7:05 ` Thomas Weber
  2010-11-27 22:19   ` Wolfgang Denk
  2010-11-25  7:05 ` [U-Boot] [PATCHv2 2/3] gdsys: osd: " Thomas Weber
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Thomas Weber @ 2010-11-25  7:05 UTC (permalink / raw)
  To: u-boot

Use the return value of cmd_usage instead of ignoring this
and returning a 1.

Signed-off-by: Thomas Weber <weber@corscience.de>
---
 common/cmd_nvedit.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 3fd8abc..cd19cc6 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -545,8 +545,7 @@ int envmatch (uchar *s1, int i2)
 static int do_env_default(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	if ((argc != 2) || (strcmp(argv[1], "-f") != 0)) {
-		cmd_usage(cmdtp);
-		return 1;
+		return cmd_usage(cmdtp);
 	}
 	set_default_env("## Resetting to default environment\n");
 	return 0;
@@ -633,15 +632,13 @@ static int do_env_export(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
 				sep = '\n';
 				break;
 			default:
-				cmd_usage(cmdtp);
-				return 1;
+				return cmd_usage(cmdtp);
 			}
 		}
 	}
 
 	if (argc < 1) {
-		cmd_usage(cmdtp);
-		return 1;
+		return cmd_usage(cmdtp);
 	}
 
 	addr = (char *)simple_strtoul(argv[0], NULL, 16);
@@ -744,15 +741,13 @@ static int do_env_import(cmd_tbl_t * cmdtp, int flag, int argc, char * const arg
 				del = 1;
 				break;
 			default:
-				cmd_usage(cmdtp);
-				return 1;
+				return cmd_usage(cmdtp);
 			}
 		}
 	}
 
 	if (argc < 1) {
-		cmd_usage(cmdtp);
-		return 1;
+		return cmd_usage(cmdtp);
 	}
 
 	if (!fmt)
@@ -857,8 +852,7 @@ static int do_env (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	if (cp)
 		return cp->cmd(cmdtp, flag, argc, argv);
 
-	cmd_usage(cmdtp);
-	return 1;
+	return cmd_usage(cmdtp);
 }
 
 U_BOOT_CMD(
-- 
1.7.3.2

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

* [U-Boot] [PATCHv2 2/3] gdsys: osd: Use return value of cmd_usage
  2010-11-25  7:05 [U-Boot] [PATCHv2 0/3] Use return value of cmd_usage Thomas Weber
  2010-11-25  7:05 ` [U-Boot] [PATCHv2 1/3] common/cmd_nvedit: " Thomas Weber
@ 2010-11-25  7:05 ` Thomas Weber
  2010-11-27 22:21   ` Wolfgang Denk
  2010-11-25  7:05 ` [U-Boot] [PATCHv2 3/3] powerpc: cmd_ecctest: " Thomas Weber
  2010-11-25  7:20 ` [U-Boot] [PATCHv2 0/3] " Mike Frysinger
  3 siblings, 1 reply; 8+ messages in thread
From: Thomas Weber @ 2010-11-25  7:05 UTC (permalink / raw)
  To: u-boot

Use the return value of cmd_usage instead of ignoring this
and returning a 1.

Signed-off-by: Thomas Weber <weber@corscience.de>
---
 board/gdsys/common/osd.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/board/gdsys/common/osd.c b/board/gdsys/common/osd.c
index 05800ff..239c870 100644
--- a/board/gdsys/common/osd.c
+++ b/board/gdsys/common/osd.c
@@ -142,8 +142,7 @@ static int osd_print(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	char *text;
 
 	if (argc < 5) {
-		cmd_usage(cmdtp);
-		return 1;
+		return cmd_usage(cmdtp);
 	}
 
 	x = simple_strtoul(argv[1], NULL, 16);
@@ -204,8 +203,7 @@ int osd_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	unsigned count = (argc > 4) ?  simple_strtoul(argv[4], NULL, 16) : 1;
 
 	if ((argc < 4) || (strlen(argv[3]) % 4)) {
-		cmd_usage(cmdtp);
-		return 1;
+		return cmd_usage(cmdtp);
 	}
 
 	x = simple_strtoul(argv[1], NULL, 16);
-- 
1.7.3.2

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

* [U-Boot] [PATCHv2 3/3] powerpc: cmd_ecctest: Use return value of cmd_usage
  2010-11-25  7:05 [U-Boot] [PATCHv2 0/3] Use return value of cmd_usage Thomas Weber
  2010-11-25  7:05 ` [U-Boot] [PATCHv2 1/3] common/cmd_nvedit: " Thomas Weber
  2010-11-25  7:05 ` [U-Boot] [PATCHv2 2/3] gdsys: osd: " Thomas Weber
@ 2010-11-25  7:05 ` Thomas Weber
  2010-11-27 22:21   ` Wolfgang Denk
  2010-11-25  7:20 ` [U-Boot] [PATCHv2 0/3] " Mike Frysinger
  3 siblings, 1 reply; 8+ messages in thread
From: Thomas Weber @ 2010-11-25  7:05 UTC (permalink / raw)
  To: u-boot

Use the return value of cmd_usage instead of ignoring this
and returning a 1.

Signed-off-by: Thomas Weber <weber@corscience.de>
---
 arch/powerpc/cpu/ppc4xx/cmd_ecctest.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/cpu/ppc4xx/cmd_ecctest.c b/arch/powerpc/cpu/ppc4xx/cmd_ecctest.c
index fd81b70..542ab69 100644
--- a/arch/powerpc/cpu/ppc4xx/cmd_ecctest.c
+++ b/arch/powerpc/cpu/ppc4xx/cmd_ecctest.c
@@ -190,15 +190,13 @@ static int do_ecctest(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	int error;
 
 	if (argc < 3) {
-		cmd_usage(cmdtp);
-		return 1;
+		return cmd_usage(cmdtp);
 	}
 
 	ptr = (u32 *)simple_strtoul(argv[1], NULL, 16);
 	error = simple_strtoul(argv[2], NULL, 16);
 	if ((error < 1) || (error > 2)) {
-		cmd_usage(cmdtp);
-		return 1;
+		return cmd_usage(cmdtp);
 	}
 
 	printf("Using address %p for %d bit ECC error injection\n",
-- 
1.7.3.2

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

* [U-Boot] [PATCHv2 0/3] Use return value of cmd_usage
  2010-11-25  7:05 [U-Boot] [PATCHv2 0/3] Use return value of cmd_usage Thomas Weber
                   ` (2 preceding siblings ...)
  2010-11-25  7:05 ` [U-Boot] [PATCHv2 3/3] powerpc: cmd_ecctest: " Thomas Weber
@ 2010-11-25  7:20 ` Mike Frysinger
  3 siblings, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2010-11-25  7:20 UTC (permalink / raw)
  To: u-boot

On Thursday, November 25, 2010 02:05:27 Thomas Weber wrote:
> cmd_usage returns 1, so its return value can be used as return value.
> 
> Some functions ignore the return value of cmd_usage and return a "1" in
> the next line. These patches change these calls so that the return value of
> cmd_usage is used as return value.

thanks, these all look sane to me

Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20101125/128f84de/attachment.pgp 

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

* [U-Boot] [PATCHv2 1/3] common/cmd_nvedit: Use return value of cmd_usage
  2010-11-25  7:05 ` [U-Boot] [PATCHv2 1/3] common/cmd_nvedit: " Thomas Weber
@ 2010-11-27 22:19   ` Wolfgang Denk
  0 siblings, 0 replies; 8+ messages in thread
From: Wolfgang Denk @ 2010-11-27 22:19 UTC (permalink / raw)
  To: u-boot

Dear Thomas Weber,

In message <1290668730-26595-2-git-send-email-weber@corscience.de> you wrote:
> Use the return value of cmd_usage instead of ignoring this
> and returning a 1.
> 
> Signed-off-by: Thomas Weber <weber@corscience.de>
> ---
>  common/cmd_nvedit.c |   18 ++++++------------
>  1 files changed, 6 insertions(+), 12 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Fantasy is like alcohol - too much is bad for you, a little bit makes
the world a better place. Like  an  exercise  bicycle  it  takes  you
nowhere, but it just might tone up the muscles that will. Daydreaming
got  us  where we are today; early in our evolution we learned to let
our minds wander so well that they started coming  back  with  souve-
nirs.   - Terry Pratchett & Stephen Briggs, _The Discworld Companion_

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

* [U-Boot] [PATCHv2 2/3] gdsys: osd: Use return value of cmd_usage
  2010-11-25  7:05 ` [U-Boot] [PATCHv2 2/3] gdsys: osd: " Thomas Weber
@ 2010-11-27 22:21   ` Wolfgang Denk
  0 siblings, 0 replies; 8+ messages in thread
From: Wolfgang Denk @ 2010-11-27 22:21 UTC (permalink / raw)
  To: u-boot

Dear Thomas Weber,

In message <1290668730-26595-3-git-send-email-weber@corscience.de> you wrote:
> Use the return value of cmd_usage instead of ignoring this
> and returning a 1.
> 
> Signed-off-by: Thomas Weber <weber@corscience.de>
> ---
>  board/gdsys/common/osd.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Overdrawn?  But I still have checks left!

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

* [U-Boot] [PATCHv2 3/3] powerpc: cmd_ecctest: Use return value of cmd_usage
  2010-11-25  7:05 ` [U-Boot] [PATCHv2 3/3] powerpc: cmd_ecctest: " Thomas Weber
@ 2010-11-27 22:21   ` Wolfgang Denk
  0 siblings, 0 replies; 8+ messages in thread
From: Wolfgang Denk @ 2010-11-27 22:21 UTC (permalink / raw)
  To: u-boot

Dear Thomas Weber,

In message <1290668730-26595-4-git-send-email-weber@corscience.de> you wrote:
> Use the return value of cmd_usage instead of ignoring this
> and returning a 1.
> 
> Signed-off-by: Thomas Weber <weber@corscience.de>
> ---
>  arch/powerpc/cpu/ppc4xx/cmd_ecctest.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I mean, I . . . think to understand you, I just don't know  what  you
are saying ...                        - Terry Pratchett, _Soul Music_

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

end of thread, other threads:[~2010-11-27 22:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-25  7:05 [U-Boot] [PATCHv2 0/3] Use return value of cmd_usage Thomas Weber
2010-11-25  7:05 ` [U-Boot] [PATCHv2 1/3] common/cmd_nvedit: " Thomas Weber
2010-11-27 22:19   ` Wolfgang Denk
2010-11-25  7:05 ` [U-Boot] [PATCHv2 2/3] gdsys: osd: " Thomas Weber
2010-11-27 22:21   ` Wolfgang Denk
2010-11-25  7:05 ` [U-Boot] [PATCHv2 3/3] powerpc: cmd_ecctest: " Thomas Weber
2010-11-27 22:21   ` Wolfgang Denk
2010-11-25  7:20 ` [U-Boot] [PATCHv2 0/3] " Mike Frysinger

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.