Skip to contentSkip to conversation

cmd_mmc: use common usage function

PATCH Superseded Mike Frysinger 2 participants 3 messages Jul 5, 2010 – Sep 21, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmd_mmc: use common usage function

Rather than using a custom "Usage:", use the common cmd_usage() function.

---
 common/cmd_mmc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
common/cmd_mmc.c +2 -2
index 698157f..329ef09 100644
@@ -161,7 +161,7 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	case 0:
 	case 1:
 	case 4:
-		printf("Usage:\n%s\n", cmdtp->usage);
+		cmd_usage(cmdtp);
 		return 1;
 
 	case 2:
@@ -218,7 +218,7 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 				n, (n == cnt) ? "OK" : "ERROR");
 			return (n == cnt) ? 0 : 1;
 		} else {
-			printf("Usage:\n%s\n", cmdtp->usage);
+			cmd_usage(cmdtp);
 			rc = 1;
 		}
 
Signature · 1 line
1.7.1.1
#1 lore raw

PATCH v2 1/1 cmd_mmc: use common usage function

Rather than using a custom "Usage:", use the common cmd_usage() function, and tail into it now that it returns 1 for us.

---
v2
- tail into cmd_usage() as pointed out by Detlev Zundel

 common/cmd_mmc.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
common/cmd_mmc.c +3 -6
index e5f5e94..5ee73ab 100644
@@ -156,8 +156,7 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	case 0:
 	case 1:
 	case 4:
-		printf("Usage:\n%s\n", cmdtp->usage);
-		return 1;
+		return cmd_usage(cmdtp);
 
 	case 2:
 		if (!strcmp(argv[1], "list")) {
@@ -212,10 +211,8 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 			printf("%d blocks written: %s\n",
 				n, (n == cnt) ? "OK" : "ERROR");
 			return (n == cnt) ? 0 : 1;
-		} else {
-			printf("Usage:\n%s\n", cmdtp->usage);
-			rc = 1;
-		}
+		} else
+			rc = cmd_usage(cmdtp);
 
 		return rc;
 	}
Signature · 1 line
1.7.2
#2 lore raw

PATCH v2 1/1 cmd_mmc: use common usage function

Dear Mike Frysinger,

Quoted 10 lines · In message <[email protected]> you wrote:

Rather than using a custom "Usage:", use the common cmd_usage() function, and tail into it now that it returns 1 for us.

---
v2
- tail into cmd_usage() as pointed out by Detlev Zundel

 common/cmd_mmc.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
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
Prof:        So the American government went to IBM to come up with a
             data encryption standard and they came up with ...
Student:     EBCDIC!