diff options
author | Wolfgang Denk <wd@denx.de> | 2010-06-28 22:00:46 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2010-07-04 23:55:42 +0200 |
commit | 54841ab50c20d6fa6c9cc3eb826989da3a22d934 (patch) | |
tree | 400f22f0a12ff0ae6c472bed6ac648befc1744a2 /common | |
parent | b218ccb5435e64ac2318bb8b6c9594ef1cc724cd (diff) |
Make sure that argv[] argument pointers are not modified.
The hush shell dynamically allocates (and re-allocates) memory for the
argument strings in the "char *argv[]" argument vector passed to
commands. Any code that modifies these pointers will cause serious
corruption of the malloc data structures and crash U-Boot, so make
sure the compiler can check that no such modifications are being done
by changing the code into "char * const argv[]".
This modification is the result of debugging a strange crash caused
after adding a new command, which used the following argument
processing code which has been working perfectly fine in all Unix
systems since version 6 - but not so in U-Boot:
int main (int argc, char **argv)
{
while (--argc > 0 && **++argv == '-') {
/* ====> */ while (*++*argv) {
switch (**argv) {
case 'd':
debug++;
break;
...
default:
usage ();
}
}
}
...
}
The line marked "====>" will corrupt the malloc data structures and
usually cause U-Boot to crash when the next command gets executed by
the shell. With the modification, the compiler will prevent this with
an
error: increment of read-only location '*argv'
N.B.: The code above can be trivially rewritten like this:
while (--argc > 0 && **++argv == '-') {
char *arg = *argv;
while (*++arg) {
switch (*arg) {
...
Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'common')
83 files changed, 268 insertions, 267 deletions
diff --git a/common/cmd_ambapp.c b/common/cmd_ambapp.c index bb20ab5149d..283c433376f 100644 --- a/common/cmd_ambapp.c +++ b/common/cmd_ambapp.c @@ -223,7 +223,7 @@ void ambapp_print_ahb(ahbctrl_pp_dev * ahb, int index) printf(" irq: %-2d (ver: %d)\n", irq, ver); } -int do_ambapp_print(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_ambapp_print(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { /* Print AHB Masters */ diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 710abdf8778..fbe73f1b3d2 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -42,7 +42,7 @@ static void print_lnum(const char *, u64); #if defined(CONFIG_PPC) static void print_str(const char *, const char *); -int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { bd_t *bd = gd->bd; char buf[32]; @@ -122,7 +122,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #elif defined(CONFIG_NIOS2) -int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { bd_t *bd = gd->bd; @@ -149,7 +149,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #elif defined(CONFIG_MICROBLAZE) -int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { bd_t *bd = gd->bd; print_num ("mem start ", (ulong)bd->bi_memstart); @@ -171,7 +171,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #elif defined(CONFIG_SPARC) -int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { bd_t *bd = gd->bd; @@ -206,7 +206,7 @@ int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) static void print_str(const char *, const char *); -int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { bd_t *bd = gd->bd; char buf[32]; @@ -256,7 +256,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) static void print_str(const char *, const char *); -int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { bd_t *bd = gd->bd; char buf[32]; @@ -284,7 +284,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #elif defined(CONFIG_MIPS) -int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { bd_t *bd = gd->bd; @@ -324,7 +324,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #elif defined(CONFIG_ARM) -int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int i; bd_t *bd = gd->bd; diff --git a/common/cmd_bedbug.c b/common/cmd_bedbug.c index 8be1c25fd7a..d01ee19ee58 100644 --- a/common/cmd_bedbug.c +++ b/common/cmd_bedbug.c @@ -73,7 +73,7 @@ void bedbug_init (void) * Entry point from the interpreter to the disassembler. Repeated calls * will resume from the last disassembled address. * ====================================================================== */ -int do_bedbug_dis (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_bedbug_dis (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { ulong addr; /* Address to start disassembly from */ ulong len; /* # of instructions to disassemble */ @@ -115,7 +115,7 @@ U_BOOT_CMD (ds, 3, 1, do_bedbug_dis, * instructions in consecutive memory locations until a '.' (period) is * entered on a line by itself. * ====================================================================== */ -int do_bedbug_asm (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_bedbug_asm (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { long mem_addr; /* Address to assemble into */ unsigned long instr; /* Machine code for text */ @@ -167,7 +167,7 @@ U_BOOT_CMD (as, 2, 0, do_bedbug_asm, * CPU-specific break point set routine. * ====================================================================== */ -int do_bedbug_break (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_bedbug_break (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { /* -------------------------------------------------- */ if (bug_ctx.do_break) @@ -263,7 +263,7 @@ void bedbug_main_loop (unsigned long addr, struct pt_regs *regs) * stopped flag in the context so that the breakpoint routine will * return. * ====================================================================== */ -int do_bedbug_continue (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_bedbug_continue (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { /* -------------------------------------------------- */ @@ -286,7 +286,7 @@ U_BOOT_CMD (continue, 1, 0, do_bedbug_continue, * the address passes control to the CPU-specific set breakpoint routine * for the current breakpoint number. * ====================================================================== */ -int do_bedbug_step (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_bedbug_step (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { unsigned long addr; /* Address to stop at */ @@ -317,7 +317,7 @@ U_BOOT_CMD (step, 1, 1, do_bedbug_step, * the address passes control to the CPU-specific set breakpoint routine * for the current breakpoint number. * ====================================================================== */ -int do_bedbug_next (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_bedbug_next (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { unsigned long addr; /* Address to stop at */ @@ -346,7 +346,7 @@ U_BOOT_CMD (next, 1, 1, do_bedbug_next, * Interpreter command to print the current stack. This assumes an EABI * architecture, so it starts with GPR R1 and works back up the stack. * ====================================================================== */ -int do_bedbug_stack (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_bedbug_stack (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { unsigned long sp; /* Stack pointer */ unsigned long func; /* LR from stack */ @@ -391,7 +391,7 @@ U_BOOT_CMD (where, 1, 1, do_bedbug_stack, * Interpreter command to dump the registers. Calls the CPU-specific * show registers routine. * ====================================================================== */ -int do_bedbug_rdump (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_bedbug_rdump (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { /* -------------------------------------------------- */ diff --git a/common/cmd_bmp.c b/common/cmd_bmp.c index 583b0090cbd..5ec798c549a 100644 --- a/common/cmd_bmp.c +++ b/common/cmd_bmp.c @@ -90,7 +90,7 @@ bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp) } #endif -static int do_bmp_info(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int do_bmp_info(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { ulong addr; @@ -109,7 +109,7 @@ static int do_bmp_info(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) return (bmp_info(addr)); } -static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { ulong addr; int x = 0, y = 0; @@ -149,7 +149,7 @@ static cmd_tbl_t cmd_bmp_sub[] = { * Return: None * */ -static int do_bmp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +static int do_bmp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { cmd_tbl_t *c; diff --git a/common/cmd_boot.c b/common/cmd_boot.c index bfc1db21d23..9ccc8c798dd 100644 --- a/common/cmd_boot.c +++ b/common/cmd_boot.c @@ -30,12 +30,12 @@ /* Allow ports to override the default behavior */ __attribute__((weak)) -unsigned long do_go_exec (ulong (*entry)(int, char *[]), int argc, char *argv[]) +unsigned long do_go_exec (ulong (*entry)(int, char * const []), int argc, char * const argv[]) { return entry (argc, argv); } -int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong addr, rc; int rcode = 0; @@ -69,7 +69,7 @@ U_BOOT_CMD( " passing 'arg' as arguments" ); -extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); +extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); U_BOOT_CMD( reset, 1, 0, do_reset, diff --git a/common/cmd_bootldr.c b/common/cmd_bootldr.c index b2a8b0e190b..c7f14d9e451 100644 --- a/common/cmd_bootldr.c +++ b/common/cmd_bootldr.c @@ -142,7 +142,7 @@ static void ldr_exec(void *addr) * to also add booting from SPI, or TWI, but this function does * not currently support that. */ -int do_bootldr(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_bootldr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { void *addr; diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 74ff205d3e8..bf77fb463d3 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -78,7 +78,7 @@ static int image_info (unsigned long addr); #if defined(CONFIG_CMD_IMLS) #include <flash.h> extern flash_info_t flash_info[]; /* info for FLASH chips */ -static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); +static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); #endif #ifdef CONFIG_SILENT_CONSOLE @@ -90,9 +90,9 @@ static image_header_t *image_get_kernel (ulong img_addr, int verify); static int fit_check_kernel (const void *fit, int os_noffset, int verify); #endif -static void *boot_get_kernel (cmd_tbl_t *cmdtp, int flag,int argc, char *argv[], +static void *boot_get_kernel (cmd_tbl_t *cmdtp, int flag,int argc, char * const argv[], bootm_headers_t *images, ulong *os_data, ulong *os_len); -extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); +extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); /* * Continue booting an OS image; caller already has: @@ -102,7 +102,7 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); * - loaded (first part of) image to header load address, * - disabled interrupts. */ -typedef int boot_os_fn (int flag, int argc, char *argv[], +typedef int boot_os_fn (int flag, int argc, char * const argv[], bootm_headers_t *images); /* pointers to os/initrd/fdt */ #ifdef CONFIG_BOOTM_LINUX @@ -121,8 +121,8 @@ static boot_os_fn do_bootm_rtems; #if defined(CONFIG_CMD_ELF) static boot_os_fn do_bootm_vxworks; static boot_os_fn do_bootm_qnxelf; -int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); -int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); +int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); +int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); #endif #if defined(CONFIG_INTEGRITY) static boot_os_fn do_bootm_integrity; @@ -206,7 +206,7 @@ static void bootm_start_lmb(void) #endif } -static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { void *os_hdr; int ret; @@ -438,10 +438,10 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress) return 0; } -static int bootm_start_standalone(ulong iflag, int argc, char *argv[]) +static int bootm_start_standalone(ulong iflag, int argc, char * const argv[]) { char *s; - int (*appl)(int, char *[]); + int (*appl)(int, char * const []); /* Don't start if "autostart" is set to "no" */ if (((s = getenv("autostart")) != NULL) && (strcmp(s, "no") == 0)) { @@ -450,7 +450,7 @@ static int bootm_start_standalone(ulong iflag, int argc, char *argv[]) setenv("filesize", buf); return 0; } - appl = (int (*)(int, char *[]))ntohl(images.ep); + appl = (int (*)(int, char * const []))ntohl(images.ep); (*appl)(argc-1, &argv[1]); return 0; @@ -473,7 +473,7 @@ static cmd_tbl_t cmd_bootm_sub[] = { U_BOOT_CMD_MKENT(go, 0, 1, (void *)BOOTM_STATE_OS_GO, "", ""), }; -int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int ret = 0; int state; @@ -576,7 +576,7 @@ int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) /* bootm - boot application image from image in memory */ /*******************************************************************/ -int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong iflag; ulong load_end = 0; @@ -811,7 +811,7 @@ static int fit_check_kernel (const void *fit, int os_noffset, int verify) * pointer to image header if valid image was found, plus kernel start * address and length, otherwise NULL */ -static void *boot_get_kernel (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], +static void *boot_get_kernel (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[], bootm_headers_t *images, ulong *os_data, ulong *os_len) { image_header_t *hdr; @@ -1012,7 +1012,7 @@ U_BOOT_CMD( /* bootd - boot default image */ /*******************************************************************/ #if defined(CONFIG_CMD_BOOTD) -int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int rcode = 0; @@ -1047,7 +1047,7 @@ U_BOOT_CMD( /* iminfo - print header info for a requested image */ /*******************************************************************/ #if defined(CONFIG_CMD_IMI) -int do_iminfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_iminfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int arg; ulong addr; @@ -1134,7 +1134,7 @@ U_BOOT_CMD( /* imls - list all images found in flash */ /*******************************************************************/ #if defined(CONFIG_CMD_IMLS) -int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { flash_info_t *info; int i, j; @@ -1237,7 +1237,7 @@ static void fixup_silent_linux () /*******************************************************************/ #ifdef CONFIG_BOOTM_NETBSD -static int do_bootm_netbsd (int flag, int argc, char *argv[], +static int do_bootm_netbsd (int flag, int argc, char * const argv[], bootm_headers_t *images) { void (*loader)(bd_t *, image_header_t *, char *, char *); @@ -1325,7 +1325,7 @@ static int do_bootm_netbsd (int flag, int argc, char *argv[], #endif /* CONFIG_BOOTM_NETBSD*/ #ifdef CONFIG_LYNXKDI -static int do_bootm_lynxkdi (int flag, int argc, char *argv[], +static int do_bootm_lynxkdi (int flag, int argc, char * const argv[], bootm_headers_t *images) { image_header_t *hdr = &images->legacy_hdr_os_copy; @@ -1347,7 +1347,7 @@ static int do_bootm_lynxkdi (int flag, int argc, char *argv[], #endif /* CONFIG_LYNXKDI */ #ifdef CONFIG_BOOTM_RTEMS -static int do_bootm_rtems (int flag, int argc, char *argv[], +static int do_bootm_rtems (int flag, int argc, char * const argv[], bootm_headers_t *images) { void (*entry_point)(bd_t *); @@ -1380,7 +1380,7 @@ static int do_bootm_rtems (int flag, int argc, char *argv[], #endif /* CONFIG_BOOTM_RTEMS */ #if defined(CONFIG_CMD_ELF) -static int do_bootm_vxworks (int flag, int argc, char *argv[], +static int do_bootm_vxworks (int flag, int argc, char * const argv[], bootm_headers_t *images) { char str[80]; @@ -1402,7 +1402,7 @@ static int do_bootm_vxworks (int flag, int argc, char *argv[], return 1; } -static int do_bootm_qnxelf(int flag, int argc, char *argv[], +static int do_bootm_qnxelf(int flag, int argc, char * const argv[], bootm_headers_t *images) { char *local_args[2]; @@ -1428,7 +1428,7 @@ static int do_bootm_qnxelf(int flag, int argc, char *argv[], #endif #ifdef CONFIG_INTEGRITY -static int do_bootm_integrity (int flag, int argc, char *argv[], +static int do_bootm_integrity (int flag, int argc, char * const argv[], bootm_headers_t *images) { void (*entry_point)(void); diff --git a/common/cmd_cache.c b/common/cmd_cache.c index 12022584196..be87b5c2d7c 100644 --- a/common/cmd_cache.c +++ b/common/cmd_cache.c @@ -29,7 +29,7 @@ static int on_off (const char *); -int do_icache ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_icache ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { switch (argc) { case 2: /* on / off */ @@ -55,7 +55,7 @@ int do_icache ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 0; } -int do_dcache ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_dcache ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { switch (argc) { case 2: /* on / off */ diff --git a/common/cmd_console.c b/common/cmd_console.c index 178fbfeaa89..d8cad6b9176 100644 --- a/common/cmd_console.c +++ b/common/cmd_console.c @@ -29,7 +29,7 @@ #include <stdio_dev.h> extern void _do_coninfo (void); -int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char *argv[]) +int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char * const argv[]) { int l; struct list_head *list = stdio_get_list(); diff --git a/common/cmd_cplbinfo.c b/common/cmd_cplbinfo.c index 1a044d29018..fc6abffe6e2 100644 --- a/common/cmd_cplbinfo.c +++ b/common/cmd_cplbinfo.c @@ -42,7 +42,7 @@ static void show_cplb_table(uint32_t *addr, uint32_t *data) /* * display current instruction and data cplb tables */ -int do_cplbinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_cplbinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { printf("%s CPLB table [%08x]:\n", "Instruction", *(uint32_t *)DMEM_CONTROL); show_cplb_table((uint32_t *)ICPLB_ADDR0, (uint32_t *)ICPLB_DATA0); diff --git a/common/cmd_cramfs.c b/common/cmd_cramfs.c index 55e2d36b51d..ab10450a4c9 100644 --- a/common/cmd_cramfs.c +++ b/common/cmd_cramfs.c @@ -98,7 +98,7 @@ extern int cramfs_info (struct part_info *info); * @param argv arguments list * @return 0 on success, 1 otherwise */ -int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *filename; int size; @@ -163,7 +163,7 @@ int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * @param argv arguments list * @return 0 on success, 1 otherwise */ -int do_cramfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_cramfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *filename = "/"; int ret; diff --git a/common/cmd_dataflash_mmc_mux.c b/common/cmd_dataflash_mmc_mux.c index 97e303e9431..de4e6761575 100644 --- a/common/cmd_dataflash_mmc_mux.c +++ b/common/cmd_dataflash_mmc_mux.c @@ -26,7 +26,7 @@ static int mmc_nspi (const char *); -int do_dataflash_mmc_mux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_dataflash_mmc_mux (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { switch (argc) { case 2: /* on / off */ diff --git a/common/cmd_date.c b/common/cmd_date.c index 3141a3968ae..50b42402673 100644 --- a/common/cmd_date.c +++ b/common/cmd_date.c @@ -43,7 +43,7 @@ const char *weekdays[] = { int mk_date (char *, struct rtc_time *); -int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { struct rtc_time tm; int rcode = 0; diff --git a/common/cmd_dcr.c b/common/cmd_dcr.c index 4f23b8d5911..45de8cd65a8 100644 --- a/common/cmd_dcr.c +++ b/common/cmd_dcr.c @@ -36,7 +36,7 @@ unsigned long set_dcr (unsigned short, unsigned long); * Interpreter command to retrieve an AMCC PPC 4xx Device Control Register * ======================================================================= */ -int do_getdcr ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] ) +int do_getdcr ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[] ) { unsigned short dcrn; /* Device Control Register Num */ unsigned long value; /* DCR's value */ @@ -63,7 +63,7 @@ int do_getdcr ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] ) * Interpreter command to set an AMCC PPC 4xx Device Control Register * ====================================================================== */ -int do_setdcr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_setdcr (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { unsigned short dcrn; /* Device Control Register Num */ unsigned long value; @@ -110,7 +110,7 @@ int do_setdcr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) * Device Control Register inderect addressing. * ======================================================================= */ -int do_getidcr (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_getidcr (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { unsigned short adr_dcrn; /* Device Control Register Num for Address */ unsigned short dat_dcrn; /* Device Control Register Num for Data */ @@ -166,7 +166,7 @@ int do_getidcr (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * Device Control Register inderect addressing. * ======================================================================= */ -int do_setidcr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_setidcr (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { unsigned short adr_dcrn; /* Device Control Register Num for Address */ unsigned short dat_dcrn; /* Device Control Register Num for Data */ diff --git a/common/cmd_df.c b/common/cmd_df.c index 7f957fed472..6a086663bff 100644 --- a/common/cmd_df.c +++ b/common/cmd_df.c @@ -6,7 +6,7 @@ #include <common.h> #include <df.h> -static int do_df(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +static int do_df(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { const char *cmd; diff --git a/common/cmd_diag.c b/common/cmd_diag.c index 0436c492f48..317ea6605fd 100644 --- a/common/cmd_diag.c +++ b/common/cmd_diag.c @@ -28,7 +28,7 @@ #include <command.h> #include <post.h> -int do_diag (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_diag (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { unsigned int i; diff --git a/common/cmd_display.c b/common/cmd_display.c index 34223952ee6..6c11aa6e3e0 100644 --- a/common/cmd_display.c +++ b/common/cmd_display.c @@ -30,7 +30,7 @@ #define CWORD_CLEAR 0x80 #define CLEAR_DELAY (110 * 2) -int do_display (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_display (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int i; int pos; diff --git a/common/cmd_dtt.c b/common/cmd_dtt.c index 3cfd36ef738..3388e43ca04 100644 --- a/common/cmd_dtt.c +++ b/common/cmd_dtt.c @@ -28,7 +28,7 @@ #include <dtt.h> #include <i2c.h> -int do_dtt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_dtt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { int i; unsigned char sensors[] = CONFIG_DTT_SENSORS; diff --git a/common/cmd_echo.c b/common/cmd_echo.c index 3ec4d485632..43a6da57226 100644 --- a/common/cmd_echo.c +++ b/common/cmd_echo.c @@ -24,7 +24,7 @@ #include <common.h> #include <command.h> -int do_echo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_echo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int i; int putnl = 1; diff --git a/common/cmd_eeprom.c b/common/cmd_eeprom.c index 519b510c77e..129162c0151 100644 --- a/common/cmd_eeprom.c +++ b/common/cmd_eeprom.c @@ -60,7 +60,7 @@ extern int eeprom_write_enable (unsigned dev_addr, int state); /* ------------------------------------------------------------------------- */ #if defined(CONFIG_CMD_EEPROM) -int do_eeprom ( cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_eeprom ( cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { const char *const fmt = "\nEEPROM @0x%lX %s: addr %08lx off %04lx count %ld ... "; diff --git a/common/cmd_elf.c b/common/cmd_elf.c index 63f6fe7a1fc..104d6e68b3c 100644 --- a/common/cmd_elf.c +++ b/common/cmd_elf.c @@ -29,7 +29,8 @@ unsigned long load_elf_image (unsigned long addr); /* Allow ports to override the default behavior */ __attribute__((weak)) -unsigned long do_bootelf_exec (ulong (*entry)(int, char *[]), int argc, char *argv[]) +unsigned long do_bootelf_exec (ulong (*entry)(int, char * const[]), + int argc, char * const argv[]) { unsigned long ret; @@ -56,7 +57,7 @@ unsigned long do_bootelf_exec (ulong (*entry)(int, char *[]), int argc, char *ar /* ====================================================================== * Interpreter command to boot an arbitrary ELF image from memory. * ====================================================================== */ -int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { unsigned long addr; /* Address of the ELF image */ unsigned long rc; /* Return value from user code */ @@ -93,7 +94,7 @@ int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * be either an ELF image or a raw binary. Will attempt to setup the * bootline and other parameters correctly. * ====================================================================== */ -int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { unsigned long addr; /* Address of image */ unsigned long bootaddr; /* Address to put the bootline */ diff --git a/common/cmd_exit.c b/common/cmd_exit.c index ed876d8c9a1..f3fc8f5e79c 100644 --- a/common/cmd_exit.c +++ b/common/cmd_exit.c @@ -24,7 +24,7 @@ #include <common.h> #include <command.h> -int do_exit(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_exit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int r; diff --git a/common/cmd_ext2.c b/common/cmd_ext2.c index b7e4048d641..49021cdb86c 100644 --- a/common/cmd_ext2.c +++ b/common/cmd_ext2.c @@ -56,7 +56,7 @@ #define PRINTF(fmt,args...) #endif -int do_ext2ls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_ext2ls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *filename = "/"; int dev=0; @@ -123,7 +123,7 @@ U_BOOT_CMD( /****************************************************************************** * Ext2fs boot command intepreter. Derived from diskboot */ -int do_ext2load (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_ext2load (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *filename = NULL; char *ep; diff --git a/common/cmd_fat.c b/common/cmd_fat.c index f3089a296e0..ede730804ef 100644 --- a/common/cmd_fat.c +++ b/common/cmd_fat.c @@ -33,7 +33,7 @@ #include <fat.h> -int do_fat_fsload (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_fat_fsload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { long size; unsigned long offset; @@ -94,7 +94,7 @@ U_BOOT_CMD( " to address 'addr' from dos filesystem" ); -int do_fat_ls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_fat_ls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *filename = "/"; int ret; @@ -141,7 +141,7 @@ U_BOOT_CMD( " - list files from 'dev' on 'interface' in a 'directory'" ); -int do_fat_fsinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_fat_fsinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int dev=0; int part=1; @@ -227,7 +227,7 @@ int find_fat_partition (void) } int -do_fat_dump (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]) +do_fat_dump (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char * const argv[]) { __u8 block[1024]; int ret; diff --git a/common/cmd_fdc.c b/common/cmd_fdc.c index 4c16d198987..486d5d48447 100644 --- a/common/cmd_fdc.c +++ b/common/cmd_fdc.c @@ -713,7 +713,7 @@ int fdc_fdos_read (void *buffer, int len) /**************************************************************************** * main routine do_fdcboot */ -int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { FD_GEO_STRUCT *pFG = (FD_GEO_STRUCT *)floppy_type; FDC_COMMAND_STRUCT *pCMD = &cmd; diff --git a/common/cmd_fdos.c b/common/cmd_fdos.c index 3cc658624d6..00f7e88e127 100644 --- a/common/cmd_fdos.c +++ b/common/cmd_fdos.c @@ -35,7 +35,7 @@ * do_fdosboot -- *----------------------------------------------------------------------------- */ -int do_fdosboot(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_fdosboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *name; char *ep; @@ -115,7 +115,7 @@ int do_fdosboot(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * do_fdosls -- *----------------------------------------------------------------------------- */ -int do_fdosls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_fdosls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *path = ""; int drive = CONFIG_SYS_FDC_DRIVE_NUMBER; diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 5df79ae3e14..cd4c6de6da6 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -42,7 +42,7 @@ DECLARE_GLOBAL_DATA_PTR; static int fdt_valid(void); -static int fdt_parse_prop(char **newval, int count, char *data, int *len); +static int fdt_parse_prop(char *const*newval, int count, char *data, int *len); static int fdt_print(const char *pathp, char *prop, int depth); /* @@ -63,7 +63,7 @@ void set_working_fdt_addr(void *addr) /* * Flattened Device Tree command, see the help for parameter definitions. */ -int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { if (argc < 2) { cmd_usage(cmdtp); @@ -515,7 +515,7 @@ static int fdt_valid(void) * data: A bytestream to be placed in the property * len: The length of the resulting bytestream */ -static int fdt_parse_prop(char **newval, int count, char *data, int *len) +static int fdt_parse_prop(char * const *newval, int count, char *data, int *len) { char *cp; /* temporary char pointer */ char *newp; /* temporary newval char pointer */ diff --git a/common/cmd_flash.c b/common/cmd_flash.c index 6361c4ef9bf..5d8fb7a8361 100644 --- a/common/cmd_flash.c +++ b/common/cmd_flash.c @@ -287,7 +287,7 @@ flash_fill_sect_ranges (ulong addr_first, ulong addr_last, } #endif /* CONFIG_SYS_NO_FLASH */ -int do_flinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_flinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { #ifndef CONFIG_SYS_NO_FLASH ulong bank; @@ -319,7 +319,7 @@ int do_flinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 0; } -int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { #ifndef CONFIG_SYS_NO_FLASH flash_info_t *info; @@ -461,7 +461,7 @@ int flash_sect_erase (ulong addr_first, ulong addr_last) } #endif /* CONFIG_SYS_NO_FLASH */ -int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { #ifndef CONFIG_SYS_NO_FLASH flash_info_t *info; diff --git a/common/cmd_fpga.c b/common/cmd_fpga.c index 2e017b84d89..ddc7a05a5b8 100644 --- a/common/cmd_fpga.c +++ b/common/cmd_fpga.c @@ -156,7 +156,7 @@ int fpga_loadbitstream(unsigned long dev, char* fpgadata, size_t size) * If there is no data addr field, the fpgadata environment variable is used. * The info command requires no data address field. */ -int do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { int op, dev = FPGA_INVALID_DEVICE; size_t data_size = 0; diff --git a/common/cmd_help.c b/common/cmd_help.c index e860dfb57c9..8c8178e41da 100644 --- a/common/cmd_help.c +++ b/common/cmd_help.c @@ -24,7 +24,7 @@ #include <common.h> #include <command.h> -int do_help(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_help(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { return _do_help(&__u_boot_cmd_start, &__u_boot_cmd_end - &__u_boot_cmd_start, diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c index 8b9c2c9490e..fb9d3b038fa 100644 --- a/common/cmd_i2c.c +++ b/common/cmd_i2c.c @@ -178,7 +178,7 @@ static uint get_alen(char *arg) * i2c read {i2c_chip} {devaddr}{.0, .1, .2} {len} {memaddr} */ -static int do_i2c_read ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +static int do_i2c_read ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { u_char chip; uint devaddr, alen, length; @@ -226,7 +226,7 @@ static int do_i2c_read ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * Syntax: * i2c md {i2c_chip} {addr}{.0, .1, .2} {len} */ -static int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +static int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { u_char chip; uint addr, alen, length; @@ -324,7 +324,7 @@ static int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * Syntax: * i2c mw {i2c_chip} {addr}{.0, .1, .2} {data} [{count}] */ -static int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +static int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { uchar chip; ulong addr; @@ -388,7 +388,7 @@ static int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * Syntax: * i2c crc32 {i2c_chip} {addr}{.0, .1, .2} {count} */ -static int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +static int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { uchar chip; ulong addr; @@ -452,7 +452,7 @@ static int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) */ static int -mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[]) +mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[]) { uchar chip; ulong addr; @@ -575,7 +575,7 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[]) * Syntax: * i2c probe {addr}{.0, .1, .2} */ -static int do_i2c_probe (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +static int do_i2c_probe (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int j; #if defined(CONFIG_SYS_I2C_NOPROBES) @@ -619,7 +619,7 @@ static int do_i2c_probe (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * {length} - Number of bytes to read * {delay} - A DECIMAL number and defaults to 1000 uSec */ -static int do_i2c_loop(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +static int do_i2c_loop(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { u_char chip; ulong alen; @@ -731,7 +731,7 @@ static void decode_bits (u_char const b, char const *str[], int const do_once) * Syntax: * i2c sdram {i2c_chip} */ -static int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { enum { unknown, EDO, SDRAM, DDR2 } type; @@ -1208,7 +1208,7 @@ static int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) #endif #if defined(CONFIG_I2C_MUX) -static int do_i2c_add_bus(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int do_i2c_add_bus(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { int ret=0; @@ -1239,7 +1239,7 @@ static int do_i2c_add_bus(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) #endif /* CONFIG_I2C_MUX */ #if defined(CONFIG_I2C_MULTI_BUS) -static int do_i2c_bus_num(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int do_i2c_bus_num(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { int bus_idx, ret=0; @@ -1257,7 +1257,7 @@ static int do_i2c_bus_num(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) } #endif /* CONFIG_I2C_MULTI_BUS */ -static int do_i2c_bus_speed(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int do_i2c_bus_speed(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { int speed, ret=0; @@ -1274,17 +1274,17 @@ static int do_i2c_bus_speed(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) return ret; } -static int do_i2c_mm(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int do_i2c_mm(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { return mod_i2c_mem (cmdtp, 1, flag, argc, argv); } -static int do_i2c_nm(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int do_i2c_nm(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { return mod_i2c_mem (cmdtp, 0, flag, argc, argv); } -static int do_i2c_reset(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int do_i2c_reset(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); return 0; @@ -1312,7 +1312,7 @@ static cmd_tbl_t cmd_i2c_sub[] = { U_BOOT_CMD_MKENT(speed, 1, 1, do_i2c_bus_speed, "", ""), }; -static int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { cmd_tbl_t *c; diff --git a/common/cmd_ide.c b/common/cmd_ide.c index 2e9f8349781..d486697bb4a 100644 --- a/common/cmd_ide.c +++ b/common/cmd_ide.c @@ -172,7 +172,7 @@ static void set_pcmcia_timing (int pmode); /* ------------------------------------------------------------------------- */ -int do_ide (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_ide (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int rcode = 0; @@ -346,7 +346,7 @@ int do_ide (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } } -int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *boot_device = NULL; char *ep; diff --git a/common/cmd_immap.c b/common/cmd_immap.c index 37e60582f60..1f59c1e1d16 100644 --- a/common/cmd_immap.c +++ b/common/cmd_immap.c @@ -43,14 +43,14 @@ DECLARE_GLOBAL_DATA_PTR; static void -unimplemented ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +unimplemented ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { printf ("Sorry, but the '%s' command has not been implemented\n", cmdtp->name); } int -do_siuinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_siuinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; @@ -81,7 +81,7 @@ do_siuinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } int -do_memcinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_memcinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; @@ -133,7 +133,7 @@ do_memcinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } int -do_sitinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_sitinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { unimplemented (cmdtp, flag, argc, argv); return 0; @@ -141,7 +141,7 @@ do_sitinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #ifdef CONFIG_8260 int -do_icinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_icinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { unimplemented (cmdtp, flag, argc, argv); return 0; @@ -149,7 +149,7 @@ do_icinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #endif int -do_carinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_carinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; @@ -233,7 +233,7 @@ static void binary (char *label, uint value, int nbits) #endif int -do_iopinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_iopinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; @@ -316,7 +316,7 @@ do_iopinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * use *uint and set the address based on cmd + port */ int -do_iopset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_iopset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { uint rcode = 0; iopin_t iopin; @@ -431,14 +431,14 @@ do_iopset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } int -do_dmainfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_dmainfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { unimplemented (cmdtp, flag, argc, argv); return 0; } int -do_fccinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_fccinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { unimplemented (cmdtp, flag, argc, argv); return 0; @@ -498,7 +498,7 @@ static void prbrg (int n, uint val) } int -do_brginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_brginfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; @@ -522,7 +522,7 @@ do_brginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } int -do_i2cinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_i2cinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; @@ -569,42 +569,42 @@ do_i2cinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } int -do_sccinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_sccinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { unimplemented (cmdtp, flag, argc, argv); return 0; } int -do_smcinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_smcinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { unimplemented (cmdtp, flag, argc, argv); return 0; } int -do_spiinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_spiinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { unimplemented (cmdtp, flag, argc, argv); return 0; } int -do_muxinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_muxinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { unimplemented (cmdtp, flag, argc, argv); return 0; } int -do_siinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_siinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { unimplemented (cmdtp, flag, argc, argv); return 0; } int -do_mccinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_mccinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { unimplemented (cmdtp, flag, argc, argv); return 0; diff --git a/common/cmd_irq.c b/common/cmd_irq.c index 2c7e6bbf0c2..48883289fc0 100644 --- a/common/cmd_irq.c +++ b/common/cmd_irq.c @@ -24,7 +24,7 @@ #include <config.h> #include <command.h> -int do_interrupts(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_interrupts(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { if (argc != 2) { @@ -49,7 +49,7 @@ U_BOOT_CMD( ); /* Implemented in $(CPU)/interrupts.c */ -int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); +int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); U_BOOT_CMD( irqinfo, 1, 1, do_irqinfo, diff --git a/common/cmd_itest.c b/common/cmd_itest.c index 58c5e7b3b56..e88d6e097c6 100644 --- a/common/cmd_itest.c +++ b/common/cmd_itest.c @@ -160,7 +160,7 @@ int binary_test (char *op, char *arg1, char *arg2, int w) } /* command line interface to the shell test */ -int do_itest ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] ) +int do_itest ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[] ) { int value, w; diff --git a/common/cmd_jffs2.c b/common/cmd_jffs2.c index 6799ccaa0ac..0e7a6b0f3b2 100644 --- a/common/cmd_jffs2.c +++ b/common/cmd_jffs2.c @@ -485,7 +485,7 @@ static struct part_info* jffs2_part_info(struct mtd_device *dev, unsigned int pa * @param argv arguments list * @return 0 on success, 1 otherwise */ -int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *fsname; char *filename; @@ -549,7 +549,7 @@ int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * @param argv arguments list * @return 0 on success, 1 otherwise */ -int do_jffs2_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_jffs2_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *filename = "/"; int ret; @@ -587,7 +587,7 @@ int do_jffs2_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * @param argv arguments list * @return 0 on success, 1 otherwise */ -int do_jffs2_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_jffs2_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { struct part_info *part; char *fsname; diff --git a/common/cmd_license.c b/common/cmd_license.c index 85a4871de0f..90fd57e25dd 100644 --- a/common/cmd_license.c +++ b/common/cmd_license.c @@ -30,7 +30,7 @@ #include <malloc.h> #include <license.h> -int do_license(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_license(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *tok, *dst = malloc(LICENSE_MAX); unsigned long len = LICENSE_MAX; diff --git a/common/cmd_load.c b/common/cmd_load.c index d6bbb786da4..52ed1fa70d7 100644 --- a/common/cmd_load.c +++ b/common/cmd_load.c @@ -51,7 +51,7 @@ static int do_echo = 1; /* -------------------------------------------------------------------- */ #if defined(CONFIG_CMD_LOADS) -int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { long offset = 0; ulong addr; @@ -255,7 +255,7 @@ read_record (char *buf, ulong len) #if defined(CONFIG_CMD_SAVES) -int do_save_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_save_serial (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong offset = 0; ulong size = 0; @@ -433,7 +433,7 @@ int his_pad_count; /* number of pad chars he needs */ char his_pad_char; /* pad chars he needs */ char his_quote; /* quote chars he'll use */ -int do_load_serial_bin (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_load_serial_bin (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong offset = 0; ulong addr; @@ -1091,7 +1091,7 @@ U_BOOT_CMD( /* -------------------------------------------------------------------- */ #if defined(CONFIG_CMD_HWFLOW) -int do_hwflow (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_hwflow (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { extern int hwflow_onoff(int); diff --git a/common/cmd_log.c b/common/cmd_log.c index 3653fe1a1ef..49deddd7f99 100644 --- a/common/cmd_log.c +++ b/common/cmd_log.c @@ -193,7 +193,7 @@ void logbuff_log(char *msg) * Return: None * */ -int do_log (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_log (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *s; unsigned long i, start, size; diff --git a/common/cmd_mac.c b/common/cmd_mac.c index 20403da39d9..1884c2aa8ae 100644 --- a/common/cmd_mac.c +++ b/common/cmd_mac.c @@ -24,7 +24,7 @@ #include <common.h> #include <command.h> -extern int do_mac(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); +extern int do_mac(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); U_BOOT_CMD( mac, 3, 1, do_mac, diff --git a/common/cmd_mem.c b/common/cmd_mem.c index 1839330760c..bcea3992dbc 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -43,7 +43,7 @@ #define PRINTF(fmt,args...) #endif -static int mod_mem(cmd_tbl_t *, int, int, int, char *[]); +static int mod_mem(cmd_tbl_t *, int, int, int, char * const []); /* Display values from last command. * Memory modify remembered values are different from display memory. @@ -60,7 +60,7 @@ static ulong base_address = 0; * md{.b, .w, .l} {addr} {len} */ #define DISP_LINE_LEN 16 -int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong addr, length; #if defined(CONFIG_HAS_DATAFLASH) @@ -158,16 +158,16 @@ int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return (rc); } -int do_mem_mm ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_mem_mm ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { return mod_mem (cmdtp, 1, flag, argc, argv); } -int do_mem_nm ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_mem_nm ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { return mod_mem (cmdtp, 0, flag, argc, argv); } -int do_mem_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_mem_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong addr, writeval, count; int size; @@ -211,7 +211,7 @@ int do_mem_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } #ifdef CONFIG_MX_CYCLIC -int do_mem_mdc ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_mem_mdc ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int i; ulong count; @@ -240,7 +240,7 @@ int do_mem_mdc ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 0; } -int do_mem_mwc ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_mem_mwc ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int i; ulong count; @@ -270,7 +270,7 @@ int do_mem_mwc ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } #endif /* CONFIG_MX_CYCLIC */ -int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong addr1, addr2, count, ngood; int size; @@ -355,7 +355,7 @@ int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return rcode; } -int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong addr, dest, count; int size; @@ -463,7 +463,7 @@ int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 0; } -int do_mem_base (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_mem_base (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { if (argc > 1) { /* Set new base address. @@ -476,7 +476,7 @@ int do_mem_base (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 0; } -int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong addr, length, i, junk; int size; @@ -547,7 +547,7 @@ int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } #ifdef CONFIG_LOOPW -int do_mem_loopw (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_mem_loopw (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong addr, length, i, data; int size; @@ -626,7 +626,7 @@ int do_mem_loopw (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * configured using CONFIG_SYS_ALT_MEMTEST. The complete test loops until * interrupted by ctrl-c or by a failure of one of the sub-tests. */ -int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { vu_long *addr, *start, *end; ulong val; @@ -984,7 +984,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * nm{.b, .w, .l} {addr} */ static int -mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[]) +mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[]) { ulong addr, i; int nbytes, size; @@ -1089,7 +1089,7 @@ mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[]) #ifndef CONFIG_CRC32_VERIFY -int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong addr, length; ulong crc; @@ -1120,7 +1120,7 @@ int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #else /* CONFIG_CRC32_VERIFY */ -int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong addr, length; ulong crc; @@ -1128,7 +1128,7 @@ int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) ulong vcrc; int verify; int ac; - char **av; + char * const *av; if (argc < 3) { usage: @@ -1175,7 +1175,7 @@ int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #endif /* CONFIG_CRC32_VERIFY */ #ifdef CONFIG_CMD_MD5SUM -int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { unsigned long addr, len; unsigned int i; @@ -1200,7 +1200,7 @@ int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #endif #ifdef CONFIG_CMD_SHA1 -int do_sha1sum(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_sha1sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { unsigned long addr, len; unsigned int i; @@ -1225,7 +1225,7 @@ int do_sha1sum(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #endif #ifdef CONFIG_CMD_UNZIP -int do_unzip ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_unzip ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { unsigned long src, dst; unsigned long src_len = ~0UL, dst_len = ~0UL; diff --git a/common/cmd_mfsl.c b/common/cmd_mfsl.c index b19ad0e6381..eeef2cddab6 100644 --- a/common/cmd_mfsl.c +++ b/common/cmd_mfsl.c @@ -31,7 +31,7 @@ #include <command.h> #include <asm/asm.h> -int do_frd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_frd (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { unsigned int fslnum; unsigned int num; @@ -189,7 +189,7 @@ int do_frd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) return 0; } -int do_fwr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_fwr (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { unsigned int fslnum; unsigned int num; @@ -348,7 +348,7 @@ int do_fwr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) } -int do_rspr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_rspr (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { unsigned int reg = 0; unsigned int val = 0; diff --git a/common/cmd_mgdisk.c b/common/cmd_mgdisk.c index 3ba62f618c0..c2d5217703b 100644 --- a/common/cmd_mgdisk.c +++ b/common/cmd_mgdisk.c @@ -26,7 +26,7 @@ #include <mg_disk.h> -int do_mg_disk_cmd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_mg_disk_cmd (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { u32 from, to, size; diff --git a/common/cmd_mii.c b/common/cmd_mii.c index 65e13c3eb22..1619a2583a2 100644 --- a/common/cmd_mii.c +++ b/common/cmd_mii.c @@ -292,7 +292,7 @@ static void extract_range( } /* ---------------------------------------------------------------- */ -int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { char op[2]; unsigned char addrlo, addrhi, reglo, reghi; diff --git a/common/cmd_misc.c b/common/cmd_misc.c index b0ced2f3b88..8439da2f7d3 100644 --- a/common/cmd_misc.c +++ b/common/cmd_misc.c @@ -27,7 +27,7 @@ #include <common.h> #include <command.h> -int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong start = get_timer(0); ulong delay; diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c index c67c9cf728f..698157f6b85 100644 --- a/common/cmd_mmc.c +++ b/common/cmd_mmc.c @@ -28,7 +28,7 @@ #ifndef CONFIG_GENERIC_MMC static int curr_device = -1; -int do_mmc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_mmc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int dev; @@ -114,7 +114,7 @@ static void print_mmcinfo(struct mmc *mmc) printf("Bus Width: %d-bit\n", mmc->bus_width); } -int do_mmcinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_mmcinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { struct mmc *mmc; int dev_num; @@ -140,7 +140,7 @@ U_BOOT_CMD(mmcinfo, 2, 0, do_mmcinfo, "" ); -int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int rc = 0; diff --git a/common/cmd_mp.c b/common/cmd_mp.c index d78c20951ee..4d7b871528d 100644 --- a/common/cmd_mp.c +++ b/common/cmd_mp.c @@ -24,7 +24,7 @@ #include <command.h> int -cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { unsigned long cpuid; diff --git a/common/cmd_mtdparts.c b/common/cmd_mtdparts.c index 116e637d57b..447486ba291 100644 --- a/common/cmd_mtdparts.c +++ b/common/cmd_mtdparts.c @@ -1713,7 +1713,7 @@ static struct part_info* mtd_part_info(struct mtd_device *dev, unsigned int part * @param argv arguments list * @return 0 on success, 1 otherwise */ -int do_chpart(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_chpart(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { /* command line only */ struct mtd_device *dev; @@ -1751,7 +1751,7 @@ int do_chpart(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * @param argv arguments list * @return 0 on success, 1 otherwise */ -int do_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { if (argc == 2) { if (strcmp(argv[1], "default") == 0) { diff --git a/common/cmd_nand.c b/common/cmd_nand.c index f611fd77178..ea80555ef89 100644 --- a/common/cmd_nand.c +++ b/common/cmd_nand.c @@ -90,7 +90,7 @@ static inline int str2long(char *p, ulong *num) } static int -arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, size_t *size) +arg_off_size(int argc, char * const argv[], nand_info_t *nand, ulong *off, size_t *size) { int idx = nand_curr_device; #if defined(CONFIG_CMD_MTDPARTS) @@ -204,7 +204,7 @@ static void nand_print_info(int idx) nand->name, nand->erasesize >> 10); } -int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { int i, dev, ret = 0; ulong addr, off; @@ -599,7 +599,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand, return 0; } -int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { char *boot_device = NULL; int idx; diff --git a/common/cmd_net.c b/common/cmd_net.c index b80a7ad8e33..3cdb07fdc72 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -28,11 +28,11 @@ #include <command.h> #include <net.h> -extern int do_bootm (cmd_tbl_t *, int, int, char *[]); +extern int do_bootm (cmd_tbl_t *, int, int, char * const []); -static int netboot_common (proto_t, cmd_tbl_t *, int , char *[]); +static int netboot_common (proto_t, cmd_tbl_t *, int , char * const []); -int do_bootp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_bootp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { return netboot_common (BOOTP, cmdtp, argc, argv); } @@ -43,7 +43,7 @@ U_BOOT_CMD( "[loadAddress] [[hostIPaddr:]bootfilename]" ); -int do_tftpb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_tftpb (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { return netboot_common (TFTP, cmdtp, argc, argv); } @@ -54,7 +54,7 @@ U_BOOT_CMD( "[loadAddress] [[hostIPaddr:]bootfilename]" ); -int do_rarpb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_rarpb (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { return netboot_common (RARP, cmdtp, argc, argv); } @@ -66,7 +66,7 @@ U_BOOT_CMD( ); #if defined(CONFIG_CMD_DHCP) -int do_dhcp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_dhcp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { return netboot_common(DHCP, cmdtp, argc, argv); } @@ -79,7 +79,7 @@ U_BOOT_CMD( #endif #if defined(CONFIG_CMD_NFS) -int do_nfs (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_nfs (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { return netboot_common(NFS, cmdtp, argc, argv); } @@ -151,7 +151,7 @@ static void netboot_update_env (void) } static int -netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[]) +netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char * const argv[]) { char *s; char *end; @@ -230,7 +230,7 @@ netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[]) } #if defined(CONFIG_CMD_PING) -int do_ping (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_ping (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { if (argc < 2) return -1; @@ -280,7 +280,7 @@ static void cdp_update_env(void) } -int do_cdp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_cdp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int r; @@ -302,7 +302,7 @@ U_BOOT_CMD( #endif #if defined(CONFIG_CMD_SNTP) -int do_sntp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_sntp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *toff; @@ -340,7 +340,7 @@ U_BOOT_CMD( #endif #if defined(CONFIG_CMD_DNS) -int do_dns(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_dns(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { if (argc == 1) { cmd_usage(cmdtp); diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index d2ef2176031..13325bc8363 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -139,7 +139,7 @@ static int printenv(char *name, int state) return i; } -int do_printenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_printenv (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int i; int rcode = 0; @@ -173,7 +173,7 @@ int do_printenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * This function will ONLY work with a in-RAM copy of the environment */ -int _do_setenv (int flag, int argc, char *argv[]) +int _do_setenv (int flag, int argc, char * const argv[]) { int i, len, oldval; int console = -1; @@ -390,7 +390,7 @@ int _do_setenv (int flag, int argc, char *argv[]) int setenv (char *varname, char *varvalue) { - char *argv[4] = { "setenv", varname, varvalue, NULL }; + char * const argv[4] = { "setenv", varname, varvalue, NULL }; if ((varvalue == NULL) || (varvalue[0] == '\0')) return _do_setenv (0, 2, argv); else @@ -400,12 +400,12 @@ int setenv (char *varname, char *varvalue) #ifdef CONFIG_HAS_UID void forceenv (char *varname, char *varvalue) { - char *argv[4] = { "forceenv", varname, varvalue, NULL }; + char * const argv[4] = { "forceenv", varname, varvalue, NULL }; _do_setenv (0xdeaf4add, 3, argv); } #endif -int do_setenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_setenv (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { if (argc < 2) { cmd_usage(cmdtp); @@ -420,7 +420,7 @@ int do_setenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) */ #if defined(CONFIG_CMD_ASKENV) -int do_askenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_askenv ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { extern char console_buffer[CONFIG_SYS_CBSIZE]; char message[CONFIG_SYS_CBSIZE]; @@ -497,7 +497,7 @@ int do_askenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * Interactively edit an environment variable */ #if defined(CONFIG_CMD_EDITENV) -int do_editenv(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_editenv(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char buffer[CONFIG_SYS_CBSIZE]; char *init_val; @@ -576,7 +576,7 @@ int getenv_r (char *name, char *buf, unsigned len) #if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_ENV_IS_NOWHERE) -int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { extern char * env_name_spec; @@ -660,7 +660,7 @@ U_BOOT_CMD( #endif #if defined(CONFIG_CMD_RUN) -int do_run (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); +int do_run (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); U_BOOT_CMD( run, CONFIG_SYS_MAXARGS, 1, do_run, "run commands in an environment variable", diff --git a/common/cmd_onenand.c b/common/cmd_onenand.c index 2646ae91d28..a3e46a338f3 100644 --- a/common/cmd_onenand.c +++ b/common/cmd_onenand.c @@ -32,7 +32,7 @@ static inline int str2long(char *p, ulong *num) return (*p != '\0' && *endptr == '\0') ? 1 : 0; } -static int arg_off_size(int argc, char *argv[], ulong *off, size_t *size) +static int arg_off_size(int argc, char * const argv[], ulong *off, size_t *size) { if (argc >= 1) { if (!(str2long(argv[0], off))) { @@ -330,13 +330,13 @@ static int onenand_dump(struct mtd_info *mtd, ulong off, int only_oob) return 0; } -static int do_onenand_info(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int do_onenand_info(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { printf("%s\n", mtd->name); return 0; } -static int do_onenand_bad(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int do_onenand_bad(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { ulong ofs; @@ -351,7 +351,7 @@ static int do_onenand_bad(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) return 0; } -static int do_onenand_read(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int do_onenand_read(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { char *s; int oob = 0; @@ -383,7 +383,7 @@ static int do_onenand_read(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) return ret == 0 ? 0 : 1; } -static int do_onenand_write(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int do_onenand_write(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { ulong addr, ofs; size_t len; @@ -409,7 +409,7 @@ static int do_onenand_write(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) return ret == 0 ? 0 : 1; } -static int do_onenand_erase(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int do_onenand_erase(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { ulong ofs; int ret = 0; @@ -445,7 +445,7 @@ static int do_onenand_erase(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) return ret == 0 ? 0 : 1; } -static int do_onenand_test(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int do_onenand_test(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { ulong ofs; int ret = 0; @@ -470,7 +470,7 @@ static int do_onenand_test(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) return ret == 0 ? 0 : 1; } -static int do_onenand_dump(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int do_onenand_dump(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { ulong ofs; int ret = 0; @@ -493,7 +493,7 @@ static int do_onenand_dump(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) return ret == 0 ? 1 : 0; } -static int do_onenand_markbad(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int do_onenand_markbad(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { int ret = 0; ulong addr; @@ -537,7 +537,7 @@ static cmd_tbl_t cmd_onenand_sub[] = { U_BOOT_CMD_MKENT(markbad, CONFIG_SYS_MAXARGS, 0, do_onenand_markbad, "", ""), }; -static int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { cmd_tbl_t *c; diff --git a/common/cmd_otp.c b/common/cmd_otp.c index 30af5a31a84..a8c73b5a866 100644 --- a/common/cmd_otp.c +++ b/common/cmd_otp.c @@ -80,7 +80,7 @@ static void set_otp_timing(bool write) bfrom_OtpCommand(OTP_INIT, write ? timing : timing & ~(-1 << 15)); } -int do_otp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_otp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { uint32_t ret, base_flags; bool prompt_user, force_read; diff --git a/common/cmd_pci.c b/common/cmd_pci.c index 8a260df8bb1..358ca60b814 100644 --- a/common/cmd_pci.c +++ b/common/cmd_pci.c @@ -471,7 +471,7 @@ pci_cfg_modify (pci_dev_t bdf, ulong addr, ulong size, ulong value, int incrflag * pci modify[.b, .w, .l] bus.device.function [addr] * pci write[.b, .w, .l] bus.device.function addr value */ -int do_pci (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_pci (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong addr = 0, value = 0, size = 0; pci_dev_t bdf = 0; diff --git a/common/cmd_pcmcia.c b/common/cmd_pcmcia.c index e576b0c5979..70e52104f54 100644 --- a/common/cmd_pcmcia.c +++ b/common/cmd_pcmcia.c @@ -66,7 +66,7 @@ extern int pcmcia_on (void); extern int pcmcia_off (void); -int do_pinit (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_pinit (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int rcode = 0; diff --git a/common/cmd_portio.c b/common/cmd_portio.c index f8befee296c..92d61d206f2 100644 --- a/common/cmd_portio.c +++ b/common/cmd_portio.c @@ -37,7 +37,7 @@ static uint in_last_addr, in_last_size; static uint out_last_addr, out_last_size, out_last_value; -int do_portio_out (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_portio_out (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { uint addr = out_last_addr; uint size = out_last_size; @@ -97,7 +97,7 @@ U_BOOT_CMD( "[.b, .w, .l] port value\n - output to IO port" ); -int do_portio_in (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_portio_in (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { uint addr = in_last_addr; uint size = in_last_size; diff --git a/common/cmd_reginfo.c b/common/cmd_reginfo.c index 89fd9ec4e9e..94b8d586986 100644 --- a/common/cmd_reginfo.c +++ b/common/cmd_reginfo.c @@ -35,7 +35,7 @@ extern void ppc4xx_reginfo(void); extern void mpc86xx_reginfo(void); #endif -int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { #if defined(CONFIG_8xx) volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR; diff --git a/common/cmd_reiser.c b/common/cmd_reiser.c index 8ede7823165..2133a1fa4fd 100644 --- a/common/cmd_reiser.c +++ b/common/cmd_reiser.c @@ -47,7 +47,7 @@ #define PRINTF(fmt,args...) #endif -int do_reiserls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_reiserls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *filename = "/"; int dev=0; @@ -110,7 +110,7 @@ U_BOOT_CMD( /****************************************************************************** * Reiserfs boot command intepreter. Derived from diskboot */ -int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *filename = NULL; char *ep; diff --git a/common/cmd_sata.c b/common/cmd_sata.c index 1693a7e312f..7be58e57c63 100644 --- a/common/cmd_sata.c +++ b/common/cmd_sata.c @@ -62,7 +62,7 @@ block_dev_desc_t *sata_get_dev(int dev) return (dev < CONFIG_SYS_SATA_MAX_DEVICE) ? &sata_dev_desc[dev] : NULL; } -int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int rc = 0; diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c index f89492fe228..5b2df28dd26 100644 --- a/common/cmd_scsi.c +++ b/common/cmd_scsi.c @@ -202,7 +202,7 @@ block_dev_desc_t * scsi_get_dev(int dev) /****************************************************************************** * scsi boot command intepreter. Derived from diskboot */ -int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *boot_device = NULL; char *ep; @@ -342,7 +342,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) /********************************************************************************* * scsi command intepreter */ -int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { switch (argc) { case 0: diff --git a/common/cmd_setexpr.c b/common/cmd_setexpr.c index da9e844a86f..b3e489fbe3c 100644 --- a/common/cmd_setexpr.c +++ b/common/cmd_setexpr.c @@ -50,7 +50,7 @@ static ulong get_arg(char *s, int w) } } -int do_setexpr(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_setexpr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong a, b; char buf[16]; diff --git a/common/cmd_sf.c b/common/cmd_sf.c index d69ae6a1ba9..4826e9f5ffc 100644 --- a/common/cmd_sf.c +++ b/common/cmd_sf.c @@ -19,7 +19,7 @@ static struct spi_flash *flash; -static int do_spi_flash_probe(int argc, char *argv[]) +static int do_spi_flash_probe(int argc, char * const argv[]) { unsigned int bus = 0; unsigned int cs; @@ -75,7 +75,7 @@ usage: return 1; } -static int do_spi_flash_read_write(int argc, char *argv[]) +static int do_spi_flash_read_write(int argc, char * const argv[]) { unsigned long addr; unsigned long offset; @@ -122,7 +122,7 @@ usage: return 1; } -static int do_spi_flash_erase(int argc, char *argv[]) +static int do_spi_flash_erase(int argc, char * const argv[]) { unsigned long offset; unsigned long len; @@ -152,7 +152,7 @@ usage: return 1; } -static int do_spi_flash(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +static int do_spi_flash(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { const char *cmd; diff --git a/common/cmd_source.c b/common/cmd_source.c index 1424d3038c0..16a627a3dd5 100644 --- a/common/cmd_source.c +++ b/common/cmd_source.c @@ -199,7 +199,7 @@ source (ulong addr, const char *fit_uname) /**************************************************/ #if defined(CONFIG_CMD_SOURCE) int -do_source (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_source (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong addr; int rcode; diff --git a/common/cmd_spi.c b/common/cmd_spi.c index ab7aac780db..bafa217d039 100644 --- a/common/cmd_spi.c +++ b/common/cmd_spi.c @@ -63,7 +63,7 @@ static uchar din[MAX_SPI_BYTES]; * The command prints out the hexadecimal string received via SPI. */ -int do_spi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_spi (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { struct spi_slave *slave; char *cp = 0; diff --git a/common/cmd_spibootldr.c b/common/cmd_spibootldr.c index d29ed2bd85a..68aa618320e 100644 --- a/common/cmd_spibootldr.c +++ b/common/cmd_spibootldr.c @@ -15,7 +15,7 @@ #include <asm/blackfin.h> #include <asm/mach-common/bits/bootrom.h> -int do_spibootldr(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_spibootldr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { s32 addr; diff --git a/common/cmd_strings.c b/common/cmd_strings.c index 3a0d8ff43ad..bbbb6b4da9f 100644 --- a/common/cmd_strings.c +++ b/common/cmd_strings.c @@ -12,7 +12,7 @@ static char *start_addr, *last_addr; -int do_strings(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_strings(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { if (argc == 1) { cmd_usage(cmdtp); diff --git a/common/cmd_terminal.c b/common/cmd_terminal.c index 60ec378b3c9..7cc1a6c6a00 100644 --- a/common/cmd_terminal.c +++ b/common/cmd_terminal.c @@ -29,7 +29,7 @@ #include <stdio_dev.h> #include <serial.h> -int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char *argv[]) +int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char * const argv[]) { int last_tilde = 0; struct stdio_dev *dev = NULL; diff --git a/common/cmd_test.c b/common/cmd_test.c index d886f893c7e..fcb5ef2f719 100644 --- a/common/cmd_test.c +++ b/common/cmd_test.c @@ -24,9 +24,9 @@ #include <common.h> #include <command.h> -int do_test(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_test(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { - char **ap; + char * const *ap; int left, adv, expr, last_expr, neg, last_cmp; /* args? */ @@ -150,7 +150,7 @@ U_BOOT_CMD( "[args..]" ); -int do_false(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_false(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { return 1; } @@ -161,7 +161,7 @@ U_BOOT_CMD( NULL ); -int do_true(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_true(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { return 0; } diff --git a/common/cmd_tsi148.c b/common/cmd_tsi148.c index f2097fddd95..1e83c886e55 100644 --- a/common/cmd_tsi148.c +++ b/common/cmd_tsi148.c @@ -402,7 +402,7 @@ int tsi148_vme_crg_window(unsigned int vmeAddr, int vam) /* * Tundra Tsi148 configuration */ -int do_tsi148(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_tsi148(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong addr1 = 0, addr2 = 0, size = 0, vam = 0, vdw = 0; char cmd = 'x'; diff --git a/common/cmd_ubi.c b/common/cmd_ubi.c index 2484b404914..2faf8d82ce8 100644 --- a/common/cmd_ubi.c +++ b/common/cmd_ubi.c @@ -436,7 +436,7 @@ static int ubi_dev_scan(struct mtd_info *info, char *ubidev, return 0; } -static int do_ubi(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int do_ubi(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { size_t size = 0; ulong addr = 0; diff --git a/common/cmd_ubifs.c b/common/cmd_ubifs.c index ed0e9db2ac2..9017041af45 100644 --- a/common/cmd_ubifs.c +++ b/common/cmd_ubifs.c @@ -42,7 +42,7 @@ int ubifs_mount(char *vol_name); int ubifs_ls(char *dir_name); int ubifs_load(char *filename, u32 addr, u32 size); -int do_ubifs_mount(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_ubifs_mount(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *vol_name; int ret; @@ -68,7 +68,7 @@ int do_ubifs_mount(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 0; } -int do_ubifs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_ubifs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *filename = "/"; int ret; @@ -89,7 +89,7 @@ int do_ubifs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return ret; } -int do_ubifs_load(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_ubifs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *filename; char *endp; diff --git a/common/cmd_universe.c b/common/cmd_universe.c index 0a6d722a0ec..a86a5746b0d 100644 --- a/common/cmd_universe.c +++ b/common/cmd_universe.c @@ -317,7 +317,7 @@ int universe_vme_slave_window(unsigned int vmeAddr, unsigned int pciAddr, int si /* * Tundra Universe configuration */ -int do_universe(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_universe(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong addr1 = 0, addr2 = 0, size = 0, vam = 0, pms = 0, vdw = 0; char cmd = 'x'; diff --git a/common/cmd_usb.c b/common/cmd_usb.c index fcb5f763c02..73d74ac0558 100644 --- a/common/cmd_usb.c +++ b/common/cmd_usb.c @@ -349,7 +349,7 @@ void usb_show_tree(struct usb_device *dev) * usb boot command intepreter. Derived from diskboot */ #ifdef CONFIG_USB_STORAGE -int do_usbboot(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_usbboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *boot_device = NULL; char *ep; @@ -506,7 +506,7 @@ int do_usbboot(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) /****************************************************************************** * usb command intepreter */ -int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int i; diff --git a/common/cmd_version.c b/common/cmd_version.c index 7f165c7b707..7d1b495c512 100644 --- a/common/cmd_version.c +++ b/common/cmd_version.c @@ -26,7 +26,7 @@ extern char version_string[]; -int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { printf("\n%s\n", version_string); diff --git a/common/cmd_vfd.c b/common/cmd_vfd.c index 9c5b0385b5a..1429d311675 100644 --- a/common/cmd_vfd.c +++ b/common/cmd_vfd.c @@ -45,7 +45,7 @@ extern int transfer_pic(unsigned char, unsigned char *, int, int); int trab_vfd (ulong bitmap); -int do_vfd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_vfd (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong bitmap; diff --git a/common/cmd_ximg.c b/common/cmd_ximg.c index 75499b4b84b..8a2cf835d89 100644 --- a/common/cmd_ximg.c +++ b/common/cmd_ximg.c @@ -43,7 +43,7 @@ #endif int -do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { ulong addr = load_addr; ulong dest = 0; diff --git a/common/cmd_yaffs2.c b/common/cmd_yaffs2.c index d448d04831d..7c01ea2a251 100644 --- a/common/cmd_yaffs2.c +++ b/common/cmd_yaffs2.c @@ -24,7 +24,7 @@ extern void cmd_yaffs_mv(const char *oldPath, const char *newPath); extern int yaffs_DumpDevStruct(const char *path); -int do_ymount (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_ymount (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *mtpoint = argv[1]; cmd_yaffs_mount(mtpoint); @@ -32,7 +32,7 @@ int do_ymount (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return(0); } -int do_yumount (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_yumount (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *mtpoint = argv[1]; cmd_yaffs_umount(mtpoint); @@ -40,7 +40,7 @@ int do_yumount (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return(0); } -int do_yls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_yls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *dirname = argv[argc-1]; @@ -49,7 +49,7 @@ int do_yls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return(0); } -int do_yrd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_yrd (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *filename = argv[1]; printf ("Reading file %s ", filename); @@ -60,7 +60,7 @@ int do_yrd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return(0); } -int do_ywr (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_ywr (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *filename = argv[1]; ulong value = simple_strtoul(argv[2], NULL, 16); @@ -74,7 +74,7 @@ int do_ywr (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return(0); } -int do_yrdm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_yrdm (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *filename = argv[1]; ulong addr = simple_strtoul(argv[2], NULL, 16); @@ -84,7 +84,7 @@ int do_yrdm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return(0); } -int do_ywrm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_ywrm (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *filename = argv[1]; ulong addr = simple_strtoul(argv[2], NULL, 16); @@ -95,7 +95,7 @@ int do_ywrm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return(0); } -int do_ymkdir (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_ymkdir (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *dirname = argv[1]; @@ -104,7 +104,7 @@ int do_ymkdir (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return(0); } -int do_yrmdir (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_yrmdir (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *dirname = argv[1]; @@ -113,7 +113,7 @@ int do_yrmdir (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return(0); } -int do_yrm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_yrm (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *path = argv[1]; @@ -122,7 +122,7 @@ int do_yrm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return(0); } -int do_ymv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_ymv (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *oldPath = argv[1]; char *newPath = argv[2]; @@ -132,7 +132,7 @@ int do_ymv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return(0); } -int do_ydump (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_ydump (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *dirname = argv[1]; if (yaffs_DumpDevStruct(dirname) != 0) diff --git a/common/command.c b/common/command.c index 67ad692004e..a1fc592c247 100644 --- a/common/command.c +++ b/common/command.c @@ -34,7 +34,7 @@ */ int _do_help (cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t * cmdtp, int - flag, int argc, char *argv[]) + flag, int argc, char * const argv[]) { int i; int rcode = 0; @@ -158,7 +158,7 @@ int cmd_usage(cmd_tbl_t *cmdtp) #ifdef CONFIG_AUTO_COMPLETE -int var_complete(int argc, char *argv[], char last_char, int maxv, char *cmdv[]) +int var_complete(int argc, char * const argv[], char last_char, int maxv, char *cmdv[]) { static char tmp_buf[512]; int space; @@ -175,7 +175,7 @@ int var_complete(int argc, char *argv[], char last_char, int maxv, char *cmdv[]) } static void install_auto_complete_handler(const char *cmd, - int (*complete)(int argc, char *argv[], char last_char, int maxv, char *cmdv[])) + int (*complete)(int argc, char * const argv[], char last_char, int maxv, char *cmdv[])) { cmd_tbl_t *cmdtp; @@ -200,7 +200,7 @@ void install_auto_complete(void) /*************************************************************************************/ -static int complete_cmdv(int argc, char *argv[], char last_char, int maxv, char *cmdv[]) +static int complete_cmdv(int argc, char * const argv[], char last_char, int maxv, char *cmdv[]) { cmd_tbl_t *cmdtp; const char *p; @@ -301,7 +301,7 @@ static int make_argv(char *s, int argvsz, char *argv[]) return argc; } -static void print_argv(const char *banner, const char *leader, const char *sep, int linemax, char *argv[]) +static void print_argv(const char *banner, const char *leader, const char *sep, int linemax, char * const argv[]) { int ll = leader != NULL ? strlen(leader) : 0; int sl = sep != NULL ? strlen(sep) : 0; @@ -328,7 +328,7 @@ static void print_argv(const char *banner, const char *leader, const char *sep, printf("\n"); } -static int find_common_prefix(char *argv[]) +static int find_common_prefix(char * const argv[]) { int i, len; char *anchor, *s, *t; diff --git a/common/hush.c b/common/hush.c index 9eea90f4280..8a74d225e9d 100644 --- a/common/hush.c +++ b/common/hush.c @@ -94,7 +94,7 @@ #include <hush.h> #include <command.h> /* find_cmd */ /*cmd_boot.c*/ -extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); /* do_bootd */ +extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); /* do_bootd */ #endif #ifndef __U_BOOT__ #include <ctype.h> /* isalpha, isdigit */ @@ -1024,7 +1024,7 @@ static void get_user_input(struct in_str *i) #ifdef CONFIG_BOOT_RETRY_TIME # ifdef CONFIG_RESET_TO_RETRY - extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); + extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); # else # error "This currently only works with CONFIG_RESET_TO_RETRY enabled" # endif @@ -1681,7 +1681,7 @@ static int run_pipe_real(struct pipe *pi) } else { int rcode; #if defined(CONFIG_CMD_BOOTD) - extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); + extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); /* avoid "bootd" recursion */ if (cmdtp->cmd == do_bootd) { @@ -3351,7 +3351,7 @@ static void setup_job_control(void) tcsetpgrp(shell_terminal, shell_pgrp); } -int hush_main(int argc, char **argv) +int hush_main(int argc, char * const *argv) { int opt; FILE *input; @@ -3588,7 +3588,7 @@ static char * make_string(char ** inp) } #ifdef __U_BOOT__ -int do_showvar (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_showvar (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int i, k; int rcode = 0; diff --git a/common/image.c b/common/image.c index 2b6007e9c66..6d8833e814d 100644 --- a/common/image.c +++ b/common/image.c @@ -60,7 +60,7 @@ static int fit_check_ramdisk (const void *fit, int os_noffset, #endif #ifdef CONFIG_CMD_BDI -extern int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); +extern int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); #endif DECLARE_GLOBAL_DATA_PTR; @@ -756,7 +756,7 @@ int genimg_has_config (bootm_headers_t *images) * 1, if ramdisk image is found but corrupted, or invalid * rd_start and rd_end are set to 0 if no ramdisk exists */ -int boot_get_ramdisk (int argc, char *argv[], bootm_headers_t *images, +int boot_get_ramdisk (int argc, char * const argv[], bootm_headers_t *images, uint8_t arch, ulong *rd_start, ulong *rd_end) { ulong rd_addr, rd_load; @@ -1279,7 +1279,7 @@ error: * 1, if fdt image is found but corrupted * of_flat_tree and of_size are set to 0 if no fdt exists */ -int boot_get_fdt (int flag, int argc, char *argv[], bootm_headers_t *images, +int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *images, char **of_flat_tree, ulong *of_size) { const image_header_t *fdt_hdr; diff --git a/common/kgdb.c b/common/kgdb.c index 9e3b64c379b..8a621ad1fc7 100644 --- a/common/kgdb.c +++ b/common/kgdb.c @@ -584,7 +584,7 @@ breakpoint(void) } int -do_kgdb(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_kgdb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { printf("Entering KGDB mode via exception handler...\n\n"); kgdb_breakpoint(argc - 1, argv + 1); diff --git a/common/lcd.c b/common/lcd.c index 64fb1c6408a..93ddedf01e8 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -78,7 +78,7 @@ static inline void lcd_putc_xy (ushort x, ushort y, uchar c); static int lcd_init (void *lcdbase); -static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]); +static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]); static void *lcd_logo (void); static int lcd_getbgcolor (void); @@ -350,7 +350,7 @@ int drv_lcd_init (void) } /*----------------------------------------------------------------------*/ -static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { #if LCD_BPP == LCD_MONOCHROME /* Setting the palette */ diff --git a/common/main.c b/common/main.c index 3760ba3d6b4..20090ee6aa7 100644 --- a/common/main.c +++ b/common/main.c @@ -51,10 +51,10 @@ void inline __show_boot_progress (int val) {} void show_boot_progress (int val) __attribute__((weak, alias("__show_boot_progress"))); #if defined(CONFIG_BOOT_RETRY_TIME) && defined(CONFIG_RESET_TO_RETRY) -extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); /* for do_reset() prototype */ +extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); /* for do_reset() prototype */ #endif -extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); +extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); #if defined(CONFIG_UPDATE_TFTP) void update_tftp (void); @@ -1414,7 +1414,7 @@ int run_command (const char *cmd, int flag) /****************************************************************************/ #if defined(CONFIG_CMD_RUN) -int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { int i; |