Use return value of cmd_usage
v2 cover Use return value of cmd_usage
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(-)
Signature · 1 line
1.7.3.2
PATCH v2 1/3 common/cmd_nvedit: Use return value of cmd_usage
Use the return value of cmd_usage instead of ignoring this and returning a 1.
--- common/cmd_nvedit.c | 18 ++++++------------ 1 files changed, 6 insertions(+), 12 deletions(-)
common/cmd_nvedit.c +6 -12
@@ -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(
Signature · 1 line
1.7.3.2
Wolfgang Denk
AppliedPATCH v2 1/3 common/cmd_nvedit: Use return value of cmd_usage
Dear Thomas Weber,
Quoted 7 lines · In message <[email protected]> you wrote:
Use the return value of
cmd_usageinstead of ignoring this and returning a 1.Signed-off-by Thomas Weber <[email protected]>--- common/cmd_nvedit.c | 18 ++++++------------ 1 files changed, 6 insertions(+), 12 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 9 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 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_
PATCH v2 2/3 gdsys: osd: Use return value of cmd_usage
In reply to Thomas WeberUse the return value of cmd_usage instead of ignoring this and returning a 1.
--- board/gdsys/common/osd.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
board/gdsys/common/osd.c +2 -4
@@ -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 );
Signature · 1 line
1.7.3.2
Wolfgang Denk
AppliedPATCH v2 2/3 gdsys: osd: Use return value of cmd_usage
Dear Thomas Weber,
Quoted 7 lines · In message <[email protected]> you wrote:
Use the return value of
cmd_usageinstead of ignoring this and returning a 1.Signed-off-by Thomas Weber <[email protected]>--- board/gdsys/common/osd.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 4 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 Overdrawn? But I still have checks left!
PATCH v2 3/3 powerpc: cmd_ecctest: Use return value of cmd_usage
In reply to Thomas WeberUse the return value of cmd_usage instead of ignoring this and returning a 1.
--- arch/powerpc/cpu/ppc4xx/cmd_ecctest.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
arch/powerpc/cpu/ppc4xx/cmd_ecctest.c +2 -4
@@ -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",
Signature · 1 line
1.7.3.2
Wolfgang Denk
AppliedPATCH v2 3/3 powerpc: cmd_ecctest: Use return value of cmd_usage
Dear Thomas Weber,
Quoted 7 lines · In message <[email protected]> you wrote:
Use the return value of
cmd_usageinstead of ignoring this and returning a 1.Signed-off-by Thomas Weber <[email protected]>--- arch/powerpc/cpu/ppc4xx/cmd_ecctest.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 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 I mean, I . . . think to understand you, I just don't know what you are saying ... - Terry Pratchett, _Soul Music_
v2 cover Use return value of cmd_usage
In reply to Thomas WeberQuoted 5 lines · On Thursday, November 25, 2010 02:05:27 Thomas Weber wrote:
cmd_usagereturns 1, so its return value can be used as return value.Some functions ignore the return value of
cmd_usageand return a "1" in the next line. These patches change these calls so that the return value ofcmd_usageis used as return value.
thanks, these all look sane to me
-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