mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 21:54:01 +00:00
Convert cmd_usage() calls in common to use a return value
Change all files in common/ to use CMD_RET_USAGE instead of calling cmd_usage() directly. I'm not completely sure about this patch since the code since impact is small (100 byte or so on ARM) and it might need splitting into smaller patches. But for now here it is. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
9d12d5d41d
commit
4c12eeb8b5
57 changed files with 167 additions and 168 deletions
|
@ -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);
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -43,7 +43,7 @@ int do_go (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;
|
||||
|
||||
addr = simple_strtoul(argv[1], NULL, 16);
|
||||
|
||||
|
|
|
@ -493,12 +493,12 @@ int do_bootm_subcommand(cmd_tbl_t *cmdtp, int flag, int argc,
|
|||
}
|
||||
} else {
|
||||
/* Unrecognized command */
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
if (images.state >= state) {
|
||||
printf("Trying to execute a command out of order\n");
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
images.state |= state;
|
||||
|
|
|
@ -54,7 +54,7 @@ int do_icache ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
icache_status() ? "ON" : "OFF");
|
||||
return 0;
|
||||
default:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ int do_dcache ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
dcache_status() ? "ON" : "OFF");
|
||||
return 0;
|
||||
default:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ int do_dataflash_mmc_mux (cmd_tbl_t *cmdtp, int flag, int argc, char * const arg
|
|||
AT91F_GetMuxStatus () ? "MMC" : "SPI");
|
||||
return 0;
|
||||
default:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -93,8 +93,7 @@ int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
|
||||
break;
|
||||
default:
|
||||
cmd_usage(cmdtp);
|
||||
rcode = 1;
|
||||
rcode = CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
/* switch back to original I2C bus */
|
||||
|
|
|
@ -45,7 +45,7 @@ int do_getdcr ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[] )
|
|||
|
||||
/* Validate arguments */
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/* Get a DCR */
|
||||
dcrn = (unsigned short) simple_strtoul (argv[1], NULL, 16);
|
||||
|
@ -71,7 +71,7 @@ int do_setdcr (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
|
||||
/* Validate arguments */
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/* Set a DCR */
|
||||
dcrn = (unsigned short) simple_strtoul (argv[1], NULL, 16);
|
||||
|
@ -116,7 +116,7 @@ int do_getidcr (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
|
||||
/* Validate arguments */
|
||||
if (argc < 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/* Find out whether ther is '.' (dot) symbol in the first parameter. */
|
||||
strncpy (buf, argv[1], sizeof(buf)-1);
|
||||
|
@ -170,7 +170,7 @@ int do_setidcr (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
|
||||
/* Validate arguments */
|
||||
if (argc < 4)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/* Find out whether ther is '.' (dot) symbol in the first parameter. */
|
||||
strncpy (buf, argv[1], sizeof(buf)-1);
|
||||
|
|
|
@ -27,7 +27,7 @@ static int do_df(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
}
|
||||
|
||||
usage:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
|
|
|
@ -104,7 +104,7 @@ int do_eeprom ( cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
}
|
||||
}
|
||||
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ int do_ext2ls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
int part_length;
|
||||
|
||||
if (argc < 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
dev = (int)simple_strtoul (argv[2], &ep, 16);
|
||||
dev_desc = get_dev(argv[1],dev);
|
||||
|
@ -163,7 +163,7 @@ int do_ext2load (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
break;
|
||||
|
||||
default:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
if (!filename) {
|
||||
|
|
|
@ -744,7 +744,7 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
boot_drive=simple_strtoul(argv[2], NULL, 10);
|
||||
break;
|
||||
default:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
/* setup FDC and scan for drives */
|
||||
if(fdc_setup(boot_drive,pCMD,pFG)==FALSE) {
|
||||
|
|
|
@ -72,7 +72,7 @@ int do_fdosboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
name = argv [2];
|
||||
break;
|
||||
default:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
/* Init physical layer */
|
||||
|
|
|
@ -66,7 +66,7 @@ void set_working_fdt_addr(void *addr)
|
|||
int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/*
|
||||
* Set the address of the fdt
|
||||
|
@ -123,7 +123,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
int err;
|
||||
|
||||
if (argc < 4)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/*
|
||||
* Set the address and length of the fdt.
|
||||
|
@ -175,7 +175,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
* Parameters: Node path, new node to be appended to the path.
|
||||
*/
|
||||
if (argc < 4)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
pathp = argv[2];
|
||||
nodep = argv[3];
|
||||
|
@ -211,7 +211,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
* Parameters: Node path, property, optional value.
|
||||
*/
|
||||
if (argc < 4)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
pathp = argv[2];
|
||||
prop = argv[3];
|
||||
|
@ -409,7 +409,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
}
|
||||
} else {
|
||||
/* Unrecognized command */
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
}
|
||||
#ifdef CONFIG_OF_BOARD_SETUP
|
||||
|
@ -422,7 +422,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
unsigned long initrd_start = 0, initrd_end = 0;
|
||||
|
||||
if ((argc != 2) && (argc != 4))
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (argc == 4) {
|
||||
initrd_start = simple_strtoul(argv[2], NULL, 16);
|
||||
|
@ -438,7 +438,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
}
|
||||
else {
|
||||
/* Unrecognized command */
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -20,7 +20,7 @@ static int do_fitupd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
ulong addr = 0UL;
|
||||
|
||||
if (argc > 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (argc == 2)
|
||||
addr = simple_strtoul(argv[1], NULL, 16);
|
||||
|
|
|
@ -335,7 +335,7 @@ int do_flerase (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;
|
||||
|
||||
if (strcmp(argv[1], "all") == 0) {
|
||||
for (bank=1; bank<=CONFIG_SYS_MAX_FLASH_BANKS; ++bank) {
|
||||
|
@ -384,7 +384,7 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
#endif
|
||||
|
||||
if (argc != 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (strcmp(argv[1], "bank") == 0) {
|
||||
bank = simple_strtoul(argv[2], NULL, 16);
|
||||
|
@ -405,7 +405,7 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
}
|
||||
|
||||
if (addr_first >= addr_last)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
rcode = flash_sect_erase(addr_first, addr_last);
|
||||
return rcode;
|
||||
|
@ -475,7 +475,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
#endif
|
||||
|
||||
if (argc < 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
#if !defined(CONFIG_SYS_NO_FLASH) || defined(CONFIG_HAS_DATAFLASH)
|
||||
if (strcmp(argv[1], "off") == 0)
|
||||
|
@ -483,7 +483,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
else if (strcmp(argv[1], "on") == 0)
|
||||
p = 1;
|
||||
else
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HAS_DATAFLASH
|
||||
|
@ -583,7 +583,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
#endif
|
||||
|
||||
if (argc != 4)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (strcmp(argv[2], "bank") == 0) {
|
||||
bank = simple_strtoul(argv[3], NULL, 16);
|
||||
|
@ -623,7 +623,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
}
|
||||
|
||||
if (addr_first >= addr_last)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
rcode = flash_sect_protect (p, addr_first, addr_last);
|
||||
#endif /* CONFIG_SYS_NO_FLASH */
|
||||
|
|
|
@ -255,7 +255,7 @@ int do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
|
||||
switch (op) {
|
||||
case FPGA_NONE:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
case FPGA_INFO:
|
||||
rc = fpga_info (dev);
|
||||
|
@ -334,7 +334,7 @@ int do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
|
||||
default:
|
||||
printf ("Unknown operation\n");
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
return (rc);
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
|
||||
if (argc != 3)
|
||||
show_usage:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
str_cmd = argv[1];
|
||||
str_gpio = argv[2];
|
||||
|
||||
|
|
|
@ -190,7 +190,7 @@ static int do_i2c_read ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
|
|||
u_char *memaddr;
|
||||
|
||||
if (argc != 5)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/*
|
||||
* I2C chip address
|
||||
|
@ -204,7 +204,7 @@ static int do_i2c_read ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
|
|||
devaddr = simple_strtoul(argv[2], NULL, 16);
|
||||
alen = get_alen(argv[2]);
|
||||
if (alen > 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/*
|
||||
* Length is the number of objects, not number of bytes.
|
||||
|
@ -242,7 +242,7 @@ static int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
|
|||
length = i2c_dp_last_length;
|
||||
|
||||
if (argc < 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if ((flag & CMD_FLAG_REPEAT) == 0) {
|
||||
/*
|
||||
|
@ -261,7 +261,7 @@ static int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
|
|||
addr = simple_strtoul(argv[2], NULL, 16);
|
||||
alen = get_alen(argv[2]);
|
||||
if (alen > 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/*
|
||||
* If another parameter, it is the length to display.
|
||||
|
@ -330,7 +330,7 @@ static int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
|
|||
int count;
|
||||
|
||||
if ((argc < 4) || (argc > 5))
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/*
|
||||
* Chip is always specified.
|
||||
|
@ -343,7 +343,7 @@ static int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
|
|||
addr = simple_strtoul(argv[2], NULL, 16);
|
||||
alen = get_alen(argv[2]);
|
||||
if (alen > 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/*
|
||||
* Value to write is always specified.
|
||||
|
@ -392,7 +392,7 @@ static int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
|
|||
ulong err;
|
||||
|
||||
if (argc < 4)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/*
|
||||
* Chip is always specified.
|
||||
|
@ -405,7 +405,7 @@ static int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
|
|||
addr = simple_strtoul(argv[2], NULL, 16);
|
||||
alen = get_alen(argv[2]);
|
||||
if (alen > 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/*
|
||||
* Count is always specified
|
||||
|
@ -451,7 +451,7 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const arg
|
|||
int nbytes;
|
||||
|
||||
if (argc != 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
#ifdef CONFIG_BOOT_RETRY_TIME
|
||||
reset_cmd_timeout(); /* got a good command to get here */
|
||||
|
@ -482,7 +482,7 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const arg
|
|||
addr = simple_strtoul(argv[2], NULL, 16);
|
||||
alen = get_alen(argv[2]);
|
||||
if (alen > 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -613,7 +613,7 @@ static int do_i2c_loop(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
|
|||
int delay;
|
||||
|
||||
if (argc < 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/*
|
||||
* Chip is always specified.
|
||||
|
@ -626,7 +626,7 @@ static int do_i2c_loop(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
|
|||
addr = simple_strtoul(argv[2], NULL, 16);
|
||||
alen = get_alen(argv[2]);
|
||||
if (alen > 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/*
|
||||
* Length is the number of objects, not number of bytes.
|
||||
|
@ -765,7 +765,7 @@ static int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
};
|
||||
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/*
|
||||
* Chip is always specified.
|
||||
|
@ -1300,7 +1300,7 @@ static int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
cmd_tbl_t *c;
|
||||
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/* Strip off leading 'i2c' command argument */
|
||||
argc--;
|
||||
|
@ -1309,9 +1309,9 @@ static int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
c = find_cmd_tbl(argv[0], &cmd_i2c_sub[0], ARRAY_SIZE(cmd_i2c_sub));
|
||||
|
||||
if (c)
|
||||
return c->cmd(cmdtp, flag, argc, argv);
|
||||
return c->cmd(cmdtp, flag, argc, argv);
|
||||
else
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
/***************************************************/
|
||||
|
|
|
@ -179,7 +179,7 @@ int do_ide(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
|||
switch (argc) {
|
||||
case 0:
|
||||
case 1:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
case 2:
|
||||
if (strncmp(argv[1], "res", 3) == 0) {
|
||||
puts("\nReset IDE"
|
||||
|
@ -232,7 +232,7 @@ int do_ide(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
|||
}
|
||||
return rcode;
|
||||
}
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
case 3:
|
||||
if (strncmp(argv[1], "dev", 3) == 0) {
|
||||
int dev = (int) simple_strtoul(argv[2], NULL, 10);
|
||||
|
@ -266,7 +266,7 @@ int do_ide(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
|||
return rcode;
|
||||
}
|
||||
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
default:
|
||||
/* at least 4 args */
|
||||
|
||||
|
@ -325,7 +325,7 @@ int do_ide(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
|||
else
|
||||
return 1;
|
||||
} else {
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
return rcode;
|
||||
|
@ -361,7 +361,7 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
|||
break;
|
||||
default:
|
||||
show_boot_progress(-42);
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
show_boot_progress(42);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ int do_interrupts(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
{
|
||||
|
||||
if (argc != 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/* on */
|
||||
if (strncmp(argv[1], "on", 2) == 0)
|
||||
|
|
|
@ -161,7 +161,7 @@ int do_itest ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[] )
|
|||
|
||||
/* Validate arguments */
|
||||
if ((argc != 4))
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/* Check for a data width specification.
|
||||
* Defaults to long (4) if no specification.
|
||||
|
|
|
@ -93,12 +93,12 @@ int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
|
||||
/* Validate arguments */
|
||||
if ((argc != 3)) {
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
cmd = get_led_cmd(argv[2]);
|
||||
if (cmd < 0) {
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
for (i = 0; led_commands[i].string; i++) {
|
||||
|
@ -132,7 +132,7 @@ int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
|
||||
/* If we ran out of matches, print Usage */
|
||||
if (!match) {
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -1102,7 +1102,7 @@ int do_hwflow (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
if (strcmp(argv[1], "on") == 0)
|
||||
hwflow_onoff(1);
|
||||
else
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
printf("RTS/CTS hardware flow control: %s\n", hwflow_onoff(0) ? "on" : "off");
|
||||
return 0;
|
||||
|
|
|
@ -241,10 +241,10 @@ int do_log (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
default:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ static int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
u8 output[16];
|
||||
|
||||
if (argc < 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
addr = simple_strtoul(argv[1], NULL, 16);
|
||||
len = simple_strtoul(argv[2], NULL, 16);
|
||||
|
|
|
@ -193,7 +193,7 @@ static int do_mdio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
struct mii_dev *bus;
|
||||
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/*
|
||||
* We use the last specified parameters, unless new ones are
|
||||
|
|
|
@ -74,7 +74,7 @@ int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
length = dp_last_length;
|
||||
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if ((flag & CMD_FLAG_REPEAT) == 0) {
|
||||
/* New command specified. Check for a size specification.
|
||||
|
@ -168,7 +168,7 @@ int do_mem_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
int size;
|
||||
|
||||
if ((argc < 3) || (argc > 4))
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/* Check for size specification.
|
||||
*/
|
||||
|
@ -210,7 +210,7 @@ int do_mem_mdc ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
ulong count;
|
||||
|
||||
if (argc < 4)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
count = simple_strtoul(argv[3], NULL, 10);
|
||||
|
||||
|
@ -237,7 +237,7 @@ int do_mem_mwc ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
ulong count;
|
||||
|
||||
if (argc < 4)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
count = simple_strtoul(argv[3], NULL, 10);
|
||||
|
||||
|
@ -266,7 +266,7 @@ int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
int rcode = 0;
|
||||
|
||||
if (argc != 4)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/* Check for size specification.
|
||||
*/
|
||||
|
@ -352,7 +352,7 @@ int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
int size;
|
||||
|
||||
if (argc != 4)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/* Check for size specification.
|
||||
*/
|
||||
|
@ -478,7 +478,7 @@ int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
volatile u_char *cp;
|
||||
|
||||
if (argc < 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/* Check for a size spefication.
|
||||
* Defaults to long if no or incorrect specification.
|
||||
|
@ -547,7 +547,7 @@ int do_mem_loopw (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
volatile u_char *cp;
|
||||
|
||||
if (argc < 4)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/* Check for a size spefication.
|
||||
* Defaults to long if no or incorrect specification.
|
||||
|
@ -979,7 +979,7 @@ mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
|
|||
int nbytes, size;
|
||||
|
||||
if (argc != 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
#ifdef CONFIG_BOOT_RETRY_TIME
|
||||
reset_cmd_timeout(); /* got a good command to get here */
|
||||
|
@ -1084,7 +1084,7 @@ int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
ulong *ptr;
|
||||
|
||||
if (argc < 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
addr = simple_strtoul (argv[1], NULL, 16);
|
||||
addr += base_address;
|
||||
|
@ -1118,7 +1118,7 @@ int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
|
||||
if (argc < 3) {
|
||||
usage:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
av = argv + 1;
|
||||
|
|
|
@ -38,13 +38,13 @@ int do_frd (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
unsigned int blocking;
|
||||
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
fslnum = (unsigned int)simple_strtoul (argv[1], NULL, 16);
|
||||
blocking = (unsigned int)simple_strtoul (argv[2], NULL, 16);
|
||||
if (fslnum < 0 || fslnum >= XILINX_FSL_NUMBER) {
|
||||
puts ("Bad number of FSL\n");
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
switch (fslnum) {
|
||||
|
@ -193,13 +193,13 @@ int do_fwr (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
unsigned int blocking;
|
||||
|
||||
if (argc < 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
fslnum = (unsigned int)simple_strtoul (argv[1], NULL, 16);
|
||||
num = (unsigned int)simple_strtoul (argv[2], NULL, 16);
|
||||
blocking = (unsigned int)simple_strtoul (argv[3], NULL, 16);
|
||||
if (fslnum < 0 || fslnum >= XILINX_FSL_NUMBER)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
switch (fslnum) {
|
||||
#if (XILINX_FSL_NUMBER > 0)
|
||||
|
@ -347,7 +347,7 @@ int do_rspr (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
unsigned int val = 0;
|
||||
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
reg = (unsigned int)simple_strtoul (argv[1], NULL, 16);
|
||||
val = (unsigned int)simple_strtoul (argv[2], NULL, 16);
|
||||
|
|
|
@ -54,7 +54,7 @@ int do_mg_disk_cmd (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
return 1;
|
||||
break;
|
||||
default:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -293,7 +293,7 @@ static int do_mii(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
const char *devname;
|
||||
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
#if defined(CONFIG_MII_INIT)
|
||||
mii_init ();
|
||||
|
@ -420,7 +420,7 @@ static int do_mii(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
else
|
||||
miiphy_set_current_dev (argv[2]);
|
||||
} else {
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -33,7 +33,7 @@ int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
ulong delay;
|
||||
|
||||
if (argc != 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
delay = simple_strtoul(argv[1], NULL, 10) * CONFIG_SYS_HZ;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ int do_mmc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
int dev;
|
||||
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (strcmp(argv[1], "init") == 0) {
|
||||
if (argc == 2) {
|
||||
|
@ -43,7 +43,7 @@ int do_mmc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
} else if (argc == 3) {
|
||||
dev = (int)simple_strtoul(argv[2], NULL, 10);
|
||||
} else {
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
if (mmc_legacy_init(dev) != 0) {
|
||||
|
@ -68,12 +68,12 @@ int do_mmc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
#endif
|
||||
curr_device = dev;
|
||||
} else {
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
printf("mmc%d is current device\n", curr_device);
|
||||
} else {
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -153,7 +153,7 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
enum mmc_state state;
|
||||
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (curr_device < 0) {
|
||||
if (get_mmc_num() > 0)
|
||||
|
@ -216,7 +216,7 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
return 1;
|
||||
}
|
||||
} else
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
mmc = find_mmc_device(dev);
|
||||
if (!mmc) {
|
||||
|
@ -307,7 +307,7 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
return (n == cnt) ? 0 : 1;
|
||||
}
|
||||
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
|
|
|
@ -78,8 +78,7 @@ static int do_mmc_spi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
return 0;
|
||||
|
||||
usage:
|
||||
cmd_usage(cmdtp);
|
||||
return 1;
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
|
|
|
@ -29,7 +29,7 @@ cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
unsigned long cpuid;
|
||||
|
||||
if (argc < 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
cpuid = simple_strtoul(argv[1], NULL, 10);
|
||||
if (!is_core_valid(cpuid)) {
|
||||
|
@ -46,17 +46,17 @@ cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
else if (strncmp(argv[2], "disable", 7) == 0)
|
||||
return cpu_disable(cpuid);
|
||||
else
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 4 or greater, make sure its release */
|
||||
if (strncmp(argv[2], "release", 7) != 0)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (cpu_release(cpuid, argc - 3, argv + 3))
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -2035,7 +2035,7 @@ int do_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
return spread_partitions();
|
||||
#endif /* CONFIG_CMD_MTDPARTS_SPREAD */
|
||||
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
/***************************************************/
|
||||
|
|
|
@ -358,7 +358,7 @@ int do_nand_env_oob(cmd_tbl_t *cmdtp, int argc, char *const argv[])
|
|||
return ret;
|
||||
|
||||
usage:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -720,7 +720,7 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
#endif
|
||||
|
||||
usage:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
|
@ -909,7 +909,7 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
usage:
|
||||
#endif
|
||||
show_boot_progress(-53);
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
show_boot_progress(53);
|
||||
|
|
|
@ -231,7 +231,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
|
|||
#endif
|
||||
default:
|
||||
show_boot_progress (-80);
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
show_boot_progress (80);
|
||||
|
@ -271,7 +271,7 @@ int do_ping (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
|
||||
NetPingIP = string_to_ip(argv[1]);
|
||||
if (NetPingIP == 0)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (NetLoop(PING) < 0) {
|
||||
printf("ping failed; host %s is not alive\n", argv[1]);
|
||||
|
@ -377,7 +377,7 @@ U_BOOT_CMD(
|
|||
int do_dns(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
if (argc == 1)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/*
|
||||
* We should check for a valid hostname:
|
||||
|
|
|
@ -173,7 +173,7 @@ static int do_env_grep(cmd_tbl_t *cmdtp, int flag,
|
|||
int rcode = 1, arg = 1, idx;
|
||||
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
memset(matched, 0, env_htab.size / 8);
|
||||
|
||||
|
@ -411,7 +411,7 @@ int setenv_addr(const char *varname, const void *addr)
|
|||
int do_env_set(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
return _do_env_set(flag, argc, argv);
|
||||
}
|
||||
|
@ -435,7 +435,7 @@ int do_env_ask(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
/* Check the syntax */
|
||||
switch (argc) {
|
||||
case 1:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
case 2: /* env_ask envname */
|
||||
sprintf(message, "Please enter '%s':", argv[1]);
|
||||
|
@ -493,7 +493,7 @@ int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
char *init_val;
|
||||
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/* Set read buffer to initial value or empty sting */
|
||||
init_val = getenv(argv[1]);
|
||||
|
@ -631,7 +631,7 @@ static int do_env_default(cmd_tbl_t *cmdtp, int flag,
|
|||
int argc, char * const argv[])
|
||||
{
|
||||
if (argc != 2 || strcmp(argv[1], "-f") != 0)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
set_default_env("## Resetting to default environment\n");
|
||||
return 0;
|
||||
|
@ -730,14 +730,14 @@ static int do_env_export(cmd_tbl_t *cmdtp, int flag,
|
|||
sep = '\n';
|
||||
break;
|
||||
default:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
}
|
||||
NXTARG: ;
|
||||
}
|
||||
|
||||
if (argc < 1)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
addr = (char *)simple_strtoul(argv[0], NULL, 16);
|
||||
|
||||
|
@ -838,13 +838,13 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag,
|
|||
del = 1;
|
||||
break;
|
||||
default:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (argc < 1)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (!fmt)
|
||||
printf("## Warning: defaulting to text format\n");
|
||||
|
@ -944,7 +944,7 @@ static int do_env(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
cmd_tbl_t *cp;
|
||||
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/* drop initial "env" arg */
|
||||
argc--;
|
||||
|
@ -955,7 +955,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);
|
||||
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
|
|
|
@ -390,7 +390,7 @@ static int do_onenand_read(cmd_tbl_t * cmdtp, int flag, int argc, char * const a
|
|||
size_t retlen = 0;
|
||||
|
||||
if (argc < 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
s = strchr(argv[0], '.');
|
||||
if ((s != NULL) && (!strcmp(s, ".oob")))
|
||||
|
@ -417,7 +417,7 @@ static int do_onenand_write(cmd_tbl_t * cmdtp, int flag, int argc, char * const
|
|||
size_t retlen = 0;
|
||||
|
||||
if (argc < 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (strncmp(argv[0] + 6, "yaffs", 5) == 0)
|
||||
withoob = 1;
|
||||
|
@ -503,7 +503,7 @@ static int do_onenand_dump(cmd_tbl_t * cmdtp, int flag, int argc, char * const a
|
|||
char *s;
|
||||
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
s = strchr(argv[0], '.');
|
||||
ofs = (int)simple_strtoul(argv[1], NULL, 16);
|
||||
|
@ -525,7 +525,7 @@ static int do_onenand_markbad(cmd_tbl_t * cmdtp, int flag, int argc, char * cons
|
|||
argv += 2;
|
||||
|
||||
if (argc <= 0)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
while (argc > 0) {
|
||||
addr = simple_strtoul(*argv, NULL, 16);
|
||||
|
@ -569,7 +569,7 @@ static int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]
|
|||
cmd_tbl_t *c;
|
||||
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
mtd = &onenand_mtd;
|
||||
|
||||
|
@ -582,7 +582,7 @@ static int do_onenand(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(
|
||||
|
|
|
@ -89,7 +89,7 @@ int do_otp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
|
||||
if (argc < 4) {
|
||||
usage:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
prompt_user = false;
|
||||
|
|
|
@ -480,7 +480,7 @@ int do_pci (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
|
||||
return 1;
|
||||
usage:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
/***************************************************/
|
||||
|
|
|
@ -44,7 +44,7 @@ int do_portio_out (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
uint value = out_last_value;
|
||||
|
||||
if (argc != 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if ((flag & CMD_FLAG_REPEAT) == 0) {
|
||||
/*
|
||||
|
@ -102,7 +102,7 @@ int do_portio_in (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
uint size = in_last_size;
|
||||
|
||||
if (argc != 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if ((flag & CMD_FLAG_REPEAT) == 0) {
|
||||
/*
|
||||
|
|
|
@ -322,7 +322,7 @@ do_pxe_get(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
int err;
|
||||
|
||||
if (argc != 1)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
|
||||
pxefile_addr_str = from_env("pxefile_addr_r");
|
||||
|
@ -1312,7 +1312,7 @@ do_pxe_boot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
} else if (argc == 2) {
|
||||
pxefile_addr_str = argv[1];
|
||||
} else {
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
if (strict_strtoul(pxefile_addr_str, 16, &pxefile_addr_r) < 0) {
|
||||
|
@ -1344,7 +1344,7 @@ int do_pxe(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
cmd_tbl_t *cp;
|
||||
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/* drop initial "pxe" arg */
|
||||
argc--;
|
||||
|
@ -1355,7 +1355,7 @@ int do_pxe(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
if (cp)
|
||||
return cp->cmd(cmdtp, flag, argc, argv);
|
||||
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
|
|
|
@ -57,7 +57,7 @@ int do_reiserls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
int part_length;
|
||||
|
||||
if (argc < 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
dev = (int)simple_strtoul (argv[2], &ep, 16);
|
||||
dev_desc = get_dev(argv[1],dev);
|
||||
|
@ -149,7 +149,7 @@ int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
break;
|
||||
|
||||
default:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
if (!filename) {
|
||||
|
|
|
@ -79,7 +79,7 @@ int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
switch (argc) {
|
||||
case 0:
|
||||
case 1:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
case 2:
|
||||
if (strncmp(argv[1],"inf", 3) == 0) {
|
||||
int i;
|
||||
|
@ -116,7 +116,7 @@ int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
}
|
||||
return rc;
|
||||
}
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
case 3:
|
||||
if (strncmp(argv[1], "dev", 3) == 0) {
|
||||
int dev = (int)simple_strtoul(argv[2], NULL, 10);
|
||||
|
@ -147,7 +147,7 @@ int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
}
|
||||
return rc;
|
||||
}
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
default: /* at least 4 args */
|
||||
if (strcmp(argv[1], "read") == 0) {
|
||||
|
@ -183,7 +183,7 @@ int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
n, (n == cnt) ? "OK" : "ERROR");
|
||||
return (n == cnt) ? 0 : 1;
|
||||
} else {
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
return rc;
|
||||
|
|
|
@ -230,7 +230,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
boot_device = argv[2];
|
||||
break;
|
||||
default:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
if (!boot_device) {
|
||||
|
@ -336,10 +336,11 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
switch (argc) {
|
||||
case 0:
|
||||
case 1: return cmd_usage(cmdtp);
|
||||
case 0:
|
||||
case 1:
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
case 2:
|
||||
case 2:
|
||||
if (strncmp(argv[1],"res",3) == 0) {
|
||||
printf("\nReset SCSI\n");
|
||||
scsi_bus_reset();
|
||||
|
@ -384,7 +385,7 @@ int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
printf("\nno SCSI devices available\n");
|
||||
return 1;
|
||||
}
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
case 3:
|
||||
if (strncmp(argv[1],"dev",3) == 0) {
|
||||
int dev = (int)simple_strtoul(argv[2], NULL, 10);
|
||||
|
@ -412,7 +413,7 @@ int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
}
|
||||
return 1;
|
||||
}
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
default:
|
||||
/* at least 4 args */
|
||||
if (strcmp(argv[1],"read") == 0) {
|
||||
|
@ -427,7 +428,7 @@ int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
return 0;
|
||||
}
|
||||
} /* switch */
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
|
|
|
@ -58,7 +58,7 @@ int do_setexpr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
|
||||
/* Validate arguments */
|
||||
if ((argc != 5) || (strlen(argv[3]) != 1))
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
w = cmd_get_data_size(argv[0], 4);
|
||||
|
||||
|
|
|
@ -298,7 +298,7 @@ done:
|
|||
return ret;
|
||||
|
||||
usage:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
|
|
|
@ -32,7 +32,7 @@ static int do_sha1sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
u8 output[20];
|
||||
|
||||
if (argc < 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
addr = simple_strtoul(argv[1], NULL, 16);
|
||||
len = simple_strtoul(argv[2], NULL, 16);
|
||||
|
|
|
@ -15,7 +15,7 @@ static char *start_addr, *last_addr;
|
|||
int do_strings(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
if (argc == 1)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if ((flag & CMD_FLAG_REPEAT) == 0) {
|
||||
start_addr = (char *)simple_strtoul(argv[1], NULL, 16);
|
||||
|
|
|
@ -38,7 +38,7 @@ static int run_command_and_time_it(int flag, int argc, char * const argv[],
|
|||
return 1;
|
||||
}
|
||||
if (argc > cmdtp->maxargs)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
/*
|
||||
* TODO(clchiou): get_timer_masked() is only defined in certain ARM
|
||||
|
@ -77,7 +77,7 @@ static int do_time(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
int retval = 0;
|
||||
|
||||
if (argc == 1)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
retval = run_command_and_time_it(0, argc - 1, argv + 1, &cycles);
|
||||
report_time(cycles);
|
||||
|
|
|
@ -438,7 +438,7 @@ static int do_ubi(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
int err = 0;
|
||||
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (mtdparts_init() != 0) {
|
||||
printf("Error initializing mtdparts!\n");
|
||||
|
@ -465,7 +465,7 @@ static int do_ubi(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
}
|
||||
|
||||
if (argc < 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
#ifdef CONFIG_CMD_UBIFS
|
||||
/*
|
||||
|
|
|
@ -53,7 +53,7 @@ int do_ubifs_mount(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
int ret;
|
||||
|
||||
if (argc != 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
vol_name = argv[1];
|
||||
debug("Using volume %s\n", vol_name);
|
||||
|
@ -94,7 +94,7 @@ void cmd_ubifs_umount(void)
|
|||
int do_ubifs_umount(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
if (argc != 1)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (ubifs_initialized == 0) {
|
||||
printf("No UBIFS volume mounted!\n");
|
||||
|
@ -141,18 +141,18 @@ int do_ubifs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
}
|
||||
|
||||
if (argc < 3)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
addr = simple_strtoul(argv[1], &endp, 16);
|
||||
if (endp == argv[1])
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
filename = argv[2];
|
||||
|
||||
if (argc == 4) {
|
||||
size = simple_strtoul(argv[3], &endp, 16);
|
||||
if (endp == argv[3])
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
debug("Loading file '%s' to address 0x%08x (size %d)\n", filename, addr, size);
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ static int do_unzip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
dst = simple_strtoul(argv[2], NULL, 16);
|
||||
break;
|
||||
default:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
if (gunzip((void *) dst, dst_len, (void *) src, &src_len) != 0)
|
||||
|
|
|
@ -379,7 +379,7 @@ int do_usbboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
boot_device = argv[2];
|
||||
break;
|
||||
default:
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
if (!boot_device) {
|
||||
|
@ -509,7 +509,7 @@ int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if ((strncmp(argv[1], "reset", 5) == 0) ||
|
||||
(strncmp(argv[1], "start", 5) == 0)) {
|
||||
|
@ -694,7 +694,7 @@ int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_USB_STORAGE */
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USB_STORAGE
|
||||
|
|
|
@ -1381,7 +1381,7 @@ int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
|||
int i;
|
||||
|
||||
if (argc < 2)
|
||||
return cmd_usage(cmdtp);
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
for (i=1; i<argc; ++i) {
|
||||
char *arg;
|
||||
|
|
Loading…
Reference in a new issue