Patchwork [U-Boot,PATCHv2,3/3] powerpc: cmd_ecctest: Use return value of cmd_usage

login
register
mail settings
Submitter Thomas Weber
Date Nov. 25, 2010, 7:05 a.m.
Message ID <1290668730-26595-4-git-send-email-weber@corscience.de>
Download mbox | patch
Permalink /patch/72991/
State Accepted
Commit e03dabe86b3bcb5be9e6d325f10747e3115cf4d1
Headers show

Comments

Thomas Weber - Nov. 25, 2010, 7:05 a.m.
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(-)
Wolfgang Denk - Nov. 27, 2010, 10:21 p.m.
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

Patch

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",