Patchwork [U-Boot,PATCHv2,2/3] gdsys: osd: 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-3-git-send-email-weber@corscience.de>
Download mbox | patch
Permalink /patch/72992/
State Accepted
Commit fd2aa8e2e7cba861097befed7ebd268956211041
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>
---
 board/gdsys/common/osd.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-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

Patch

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);