Re: [U-Boot] [PATCH v5 9/9] Convert cmd_usage() calls in common to use a return value

2012-03-06 Thread Wolfgang Denk
Dear Simon Glass,

In message 1329285566-30386-10-git-send-email-...@chromium.org you wrote:
 Change all files in common/ to use CMD_RET_USAGE instead of calling
 cmd_usage() directly. This saves about 100 byte or so on ARM.
 
 Signed-off-by: Simon Glass s...@chromium.org
 ---
 Changes in v2:
 - Fix minor errors one of which created a warning
 - Squash i2c patch into the common/ patch
 
 Changes in v3:
 - Rebase to master
 
  common/cmd_bedbug.c|4 ++--
  common/cmd_bmp.c   |6 +++---
  common/cmd_boot.c  |2 +-
  common/cmd_bootm.c |4 ++--
  common/cmd_cache.c |4 ++--
  common/cmd_dataflash_mmc_mux.c |2 +-
  common/cmd_date.c  |3 +--
  common/cmd_dcr.c   |8 
  common/cmd_df.c|2 +-
  common/cmd_eeprom.c|2 +-
  common/cmd_ext2.c  |4 ++--
  common/cmd_fdc.c   |2 +-
  common/cmd_fdos.c  |2 +-
  common/cmd_fdt.c   |   14 +++---
  common/cmd_fitupd.c|2 +-
  common/cmd_flash.c |   14 +++---
  common/cmd_fpga.c  |4 ++--
  common/cmd_gpio.c  |2 +-
  common/cmd_i2c.c   |   32 
  common/cmd_ide.c   |   10 +-
  common/cmd_irq.c   |2 +-
  common/cmd_itest.c |2 +-
  common/cmd_led.c   |6 +++---
  common/cmd_load.c  |2 +-
  common/cmd_log.c   |4 ++--
  common/cmd_md5sum.c|2 +-
  common/cmd_mdio.c  |2 +-
  common/cmd_mem.c   |   22 +++---
  common/cmd_mfsl.c  |   10 +-
  common/cmd_mgdisk.c|2 +-
  common/cmd_mii.c   |4 ++--
  common/cmd_misc.c  |2 +-
  common/cmd_mmc.c   |   14 +++---
  common/cmd_mmc_spi.c   |3 +--
  common/cmd_mp.c|8 
  common/cmd_mtdparts.c  |2 +-
  common/cmd_nand.c  |6 +++---
  common/cmd_net.c   |6 +++---
  common/cmd_nvedit.c|   22 +++---
  common/cmd_onenand.c   |   12 ++--
  common/cmd_otp.c   |2 +-
  common/cmd_pci.c   |2 +-
  common/cmd_portio.c|4 ++--
  common/cmd_pxe.c   |8 
  common/cmd_reiser.c|4 ++--
  common/cmd_sata.c  |8 
  common/cmd_scsi.c  |   15 ---
  common/cmd_setexpr.c   |2 +-
  common/cmd_sf.c|2 +-
  common/cmd_sha1sum.c   |2 +-
  common/cmd_strings.c   |2 +-
  common/cmd_time.c  |4 ++--
  common/cmd_ubi.c   |4 ++--
  common/cmd_ubifs.c |   10 +-
  common/cmd_unzip.c |2 +-
  common/cmd_usb.c   |6 +++---
  common/main.c  |2 +-
  57 files changed, 167 insertions(+), 168 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: w...@denx.de
It may be bad manners to talk with your mouth full, but it isn't  too
good either if you speak when your head is empty.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v5 9/9] Convert cmd_usage() calls in common to use a return value

2012-02-14 Thread Simon Glass
Change all files in common/ to use CMD_RET_USAGE instead of calling
cmd_usage() directly. This saves about 100 byte or so on ARM.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Fix minor errors one of which created a warning
- Squash i2c patch into the common/ patch

Changes in v3:
- Rebase to master

 common/cmd_bedbug.c|4 ++--
 common/cmd_bmp.c   |6 +++---
 common/cmd_boot.c  |2 +-
 common/cmd_bootm.c |4 ++--
 common/cmd_cache.c |4 ++--
 common/cmd_dataflash_mmc_mux.c |2 +-
 common/cmd_date.c  |3 +--
 common/cmd_dcr.c   |8 
 common/cmd_df.c|2 +-
 common/cmd_eeprom.c|2 +-
 common/cmd_ext2.c  |4 ++--
 common/cmd_fdc.c   |2 +-
 common/cmd_fdos.c  |2 +-
 common/cmd_fdt.c   |   14 +++---
 common/cmd_fitupd.c|2 +-
 common/cmd_flash.c |   14 +++---
 common/cmd_fpga.c  |4 ++--
 common/cmd_gpio.c  |2 +-
 common/cmd_i2c.c   |   32 
 common/cmd_ide.c   |   10 +-
 common/cmd_irq.c   |2 +-
 common/cmd_itest.c |2 +-
 common/cmd_led.c   |6 +++---
 common/cmd_load.c  |2 +-
 common/cmd_log.c   |4 ++--
 common/cmd_md5sum.c|2 +-
 common/cmd_mdio.c  |2 +-
 common/cmd_mem.c   |   22 +++---
 common/cmd_mfsl.c  |   10 +-
 common/cmd_mgdisk.c|2 +-
 common/cmd_mii.c   |4 ++--
 common/cmd_misc.c  |2 +-
 common/cmd_mmc.c   |   14 +++---
 common/cmd_mmc_spi.c   |3 +--
 common/cmd_mp.c|8 
 common/cmd_mtdparts.c  |2 +-
 common/cmd_nand.c  |6 +++---
 common/cmd_net.c   |6 +++---
 common/cmd_nvedit.c|   22 +++---
 common/cmd_onenand.c   |   12 ++--
 common/cmd_otp.c   |2 +-
 common/cmd_pci.c   |2 +-
 common/cmd_portio.c|4 ++--
 common/cmd_pxe.c   |8 
 common/cmd_reiser.c|4 ++--
 common/cmd_sata.c  |8 
 common/cmd_scsi.c  |   15 ---
 common/cmd_setexpr.c   |2 +-
 common/cmd_sf.c|2 +-
 common/cmd_sha1sum.c   |2 +-
 common/cmd_strings.c   |2 +-
 common/cmd_time.c  |4 ++--
 common/cmd_ubi.c   |4 ++--
 common/cmd_ubifs.c |   10 +-
 common/cmd_unzip.c |2 +-
 common/cmd_usb.c   |6 +++---
 common/main.c  |2 +-
 57 files changed, 167 insertions(+), 168 deletions(-)

diff --git a/common/cmd_bedbug.c b/common/cmd_bedbug.c
index 5b08123..9791423 100644
--- a/common/cmd_bedbug.c
+++ b/common/cmd_bedbug.c
@@ -84,7 +84,7 @@ int do_bedbug_dis (cmd_tbl_t * cmdtp, int flag, int argc, 
char * const argv[])
len = dis_last_len;
 
if (argc  2)
-   return cmd_usage(cmdtp);
+   return CMD_RET_USAGE;
 
if ((flag  CMD_FLAG_REPEAT) == 0) {
/* New command */
@@ -123,7 +123,7 @@ int do_bedbug_asm (cmd_tbl_t * cmdtp, int flag, int argc, 
char * const argv[])
int rcode = 0;
 
if (argc  2)
-   return cmd_usage(cmdtp);
+   return CMD_RET_USAGE;
 
printf (\nEnter '.' when done\n);
mem_addr = simple_strtoul (argv[1], NULL, 16);
diff --git a/common/cmd_bmp.c b/common/cmd_bmp.c
index 682f395..4c29fa3 100644
--- a/common/cmd_bmp.c
+++ b/common/cmd_bmp.c
@@ -102,7 +102,7 @@ static int do_bmp_info(cmd_tbl_t * cmdtp, int flag, int 
argc, char * const argv[
addr = simple_strtoul(argv[1], NULL, 16);
break;
default:
-   return cmd_usage(cmdtp);
+   return CMD_RET_USAGE;
}
 
return (bmp_info(addr));
@@ -126,7 +126,7 @@ static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int 
argc, char * const ar
y = simple_strtoul(argv[3], NULL, 10);
break;
default:
-   return cmd_usage(cmdtp);
+   return CMD_RET_USAGE;
}
 
 return (bmp_display(addr, x, y));
@@ -166,7 +166,7 @@ static int do_bmp(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
if (c)
return  c-cmd(cmdtp, flag, argc, argv);
else
-   return cmd_usage(cmdtp);
+   return CMD_RET_USAGE;
 }
 
 U_BOOT_CMD(
diff --git a/common/cmd_boot.c b/common/cmd_boot.c
index 0afd939..a799b33 100644
--- a/common/cmd_boot.c
+++ b/common/cmd_boot.c
@@ -43,7 +43,7 @@ int do_go (cmd_tbl_t *cmdtp,