summaryrefslogtreecommitdiffstats
path: root/board/esd
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2010-06-28 22:00:46 +0200
committerWolfgang Denk <wd@denx.de>2010-07-04 23:55:42 +0200
commit54841ab50c20d6fa6c9cc3eb826989da3a22d934 (patch)
tree400f22f0a12ff0ae6c472bed6ac648befc1744a2 /board/esd
parentb218ccb5435e64ac2318bb8b6c9594ef1cc724cd (diff)
downloadblackbird-obmc-uboot-54841ab50c20d6fa6c9cc3eb826989da3a22d934.tar.gz
blackbird-obmc-uboot-54841ab50c20d6fa6c9cc3eb826989da3a22d934.zip
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 'board/esd')
-rw-r--r--board/esd/apc405/apc405.c2
-rw-r--r--board/esd/ar405/ar405.c8
-rw-r--r--board/esd/ash405/ash405.c2
-rw-r--r--board/esd/canbt/canbt.c2
-rw-r--r--board/esd/cms700/cms700.c2
-rw-r--r--board/esd/common/auto_update.c2
-rw-r--r--board/esd/common/cmd_loadpci.c2
-rw-r--r--board/esd/common/lcd.c2
-rw-r--r--board/esd/common/xilinx_jtag/micro.c2
-rw-r--r--board/esd/cpci2dp/cpci2dp.c2
-rw-r--r--board/esd/cpci405/cpci405.c8
-rw-r--r--board/esd/cpci5200/cpci5200.c2
-rw-r--r--board/esd/cpci750/cpci750.c6
-rw-r--r--board/esd/cpci750/sdram_init.c2
-rw-r--r--board/esd/cpciiser4/cpciiser4.c2
-rw-r--r--board/esd/dasa_sim/cmd_dasa_sim.c2
-rw-r--r--board/esd/du405/du405.c2
-rw-r--r--board/esd/du440/du440.c16
-rw-r--r--board/esd/hh405/hh405.c4
-rw-r--r--board/esd/ocrtc/cmd_ocrtc.c4
-rw-r--r--board/esd/pci405/cmd_pci405.c2
-rw-r--r--board/esd/pci405/pci405.c4
-rw-r--r--board/esd/pf5200/pf5200.c6
-rw-r--r--board/esd/plu405/plu405.c4
-rw-r--r--board/esd/pmc405de/pmc405de.c8
-rw-r--r--board/esd/pmc440/cmd_pmc440.c18
-rw-r--r--board/esd/tasreg/tasreg.c14
-rw-r--r--board/esd/vme8349/caddy.c2
-rw-r--r--board/esd/voh405/voh405.c4
-rw-r--r--board/esd/wuh405/wuh405.c2
30 files changed, 69 insertions, 69 deletions
diff --git a/board/esd/apc405/apc405.c b/board/esd/apc405/apc405.c
index 72c0907e01..b58c1ebfad 100644
--- a/board/esd/apc405/apc405.c
+++ b/board/esd/apc405/apc405.c
@@ -37,7 +37,7 @@ DECLARE_GLOBAL_DATA_PTR;
#undef FPGA_DEBUG
-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[]);
extern void lxt971_no_sleep(void);
extern ulong flash_get_size (ulong base, int banknum);
diff --git a/board/esd/ar405/ar405.c b/board/esd/ar405/ar405.c
index a632cb42d6..21b2432c47 100644
--- a/board/esd/ar405/ar405.c
+++ b/board/esd/ar405/ar405.c
@@ -30,7 +30,7 @@
DECLARE_GLOBAL_DATA_PTR;
/*cmd_boot.c*/
-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[]);
extern void lxt971_no_sleep(void);
/* ------------------------------------------------------------------------- */
@@ -196,7 +196,7 @@ int checkboard (void)
/*
* Some test routines
*/
-int do_digtest(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_digtest(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int i;
int k;
@@ -257,7 +257,7 @@ struct io {
short dummy;
};
-int do_anatest(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_anatest(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
short val;
int i;
@@ -353,7 +353,7 @@ void cyclicInt(void *ptr)
}
-int do_inctest(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_inctest(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong *incin;
int i;
diff --git a/board/esd/ash405/ash405.c b/board/esd/ash405/ash405.c
index 0615959316..03c409829c 100644
--- a/board/esd/ash405/ash405.c
+++ b/board/esd/ash405/ash405.c
@@ -33,7 +33,7 @@
#define FPGA_DEBUG
#endif
-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[]);
extern void lxt971_no_sleep(void);
/* fpga configuration data - gzip compressed and generated by bin2c */
diff --git a/board/esd/canbt/canbt.c b/board/esd/canbt/canbt.c
index 5a3f61de3c..bfec5489d6 100644
--- a/board/esd/canbt/canbt.c
+++ b/board/esd/canbt/canbt.c
@@ -30,7 +30,7 @@
DECLARE_GLOBAL_DATA_PTR;
/*cmd_boot.c*/
-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[]);
/* ------------------------------------------------------------------------- */
diff --git a/board/esd/cms700/cms700.c b/board/esd/cms700/cms700.c
index 391fbf4c1b..20346e15ac 100644
--- a/board/esd/cms700/cms700.c
+++ b/board/esd/cms700/cms700.c
@@ -157,7 +157,7 @@ int eeprom_write_enable (unsigned dev_addr, int state)
return state;
}
-int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int query = argc == 1;
int state = 0;
diff --git a/board/esd/common/auto_update.c b/board/esd/common/auto_update.c
index c4a49e2f18..4dfea71966 100644
--- a/board/esd/common/auto_update.c
+++ b/board/esd/common/auto_update.c
@@ -492,7 +492,7 @@ int do_auto_update(void)
return 0;
}
-int auto_update(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int auto_update(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
do_auto_update();
diff --git a/board/esd/common/cmd_loadpci.c b/board/esd/common/cmd_loadpci.c
index eecae0a7fd..87da27db10 100644
--- a/board/esd/common/cmd_loadpci.c
+++ b/board/esd/common/cmd_loadpci.c
@@ -37,7 +37,7 @@ extern int do_source (cmd_tbl_t *, int, int, char *[]);
/*
* Command loadpci: wait for signal from host and boot image.
*/
-int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
u32 *ptr = 0;
int count = 0;
diff --git a/board/esd/common/lcd.c b/board/esd/common/lcd.c
index 5c50b4c8dc..9109b64a1c 100644
--- a/board/esd/common/lcd.c
+++ b/board/esd/common/lcd.c
@@ -339,7 +339,7 @@ int lcd_init(uchar *lcd_reg, uchar *lcd_mem, S1D_REGS *regs, int reg_count,
return lcd_bmp(logo_bmp);
}
-int do_esdbmp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_esdbmp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong addr;
#ifdef CONFIG_VIDEO_SM501
diff --git a/board/esd/common/xilinx_jtag/micro.c b/board/esd/common/xilinx_jtag/micro.c
index 414e82135c..9823e5e8a7 100644
--- a/board/esd/common/xilinx_jtag/micro.c
+++ b/board/esd/common/xilinx_jtag/micro.c
@@ -1828,7 +1828,7 @@ int xsvfExecute(void)
* ppzArgv - array of ptrs to strings (command-line arguments).
* Returns: int - Legacy return value: 1 = success; 0 = error.
*****************************************************************************/
-int do_cpld(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_cpld(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int iErrorCode;
char* pzXsvfFileName;
diff --git a/board/esd/cpci2dp/cpci2dp.c b/board/esd/cpci2dp/cpci2dp.c
index 6d9814f163..00456a7003 100644
--- a/board/esd/cpci2dp/cpci2dp.c
+++ b/board/esd/cpci2dp/cpci2dp.c
@@ -149,7 +149,7 @@ int eeprom_write_enable (unsigned dev_addr, int state) {
#endif
#if defined(CONFIG_SYS_EEPROM_WREN)
-int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int query = argc == 1;
int state = 0;
diff --git a/board/esd/cpci405/cpci405.c b/board/esd/cpci405/cpci405.c
index 24db8830c7..51d3355816 100644
--- a/board/esd/cpci405/cpci405.c
+++ b/board/esd/cpci405/cpci405.c
@@ -32,7 +32,7 @@
DECLARE_GLOBAL_DATA_PTR;
-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[]);
extern void __ft_board_setup(void *blob, bd_t *bd);
#undef FPGA_DEBUG
@@ -650,7 +650,7 @@ int OWReadByte(void)
return result;
}
-int do_onewire(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_onewire(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
unsigned short val;
int result;
@@ -698,7 +698,7 @@ U_BOOT_CMD(
/*
* Write backplane ip-address...
*/
-int do_get_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_get_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
bd_t *bd = gd->bd;
char *buf;
@@ -756,7 +756,7 @@ U_BOOT_CMD(
/*
* Set and print backplane ip...
*/
-int do_set_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_set_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
char *buf;
char str[32];
diff --git a/board/esd/cpci5200/cpci5200.c b/board/esd/cpci5200/cpci5200.c
index 36fcf7f87d..abac217527 100644
--- a/board/esd/cpci5200/cpci5200.c
+++ b/board/esd/cpci5200/cpci5200.c
@@ -265,7 +265,7 @@ int board_eth_init(bd_t *bis)
return pci_eth_init(bis);
}
-int do_writepci(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_writepci(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
unsigned int addr;
unsigned int size;
diff --git a/board/esd/cpci750/cpci750.c b/board/esd/cpci750/cpci750.c
index a199d46182..f9f7c7fdf1 100644
--- a/board/esd/cpci750/cpci750.c
+++ b/board/esd/cpci750/cpci750.c
@@ -562,7 +562,7 @@ int display_mem_map (void)
/*
* Command loadpci: wait for signal from host and boot image.
*/
-int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
volatile unsigned int *ptr;
int count = 0;
@@ -1056,7 +1056,7 @@ void board_prebootm_init ()
dcache_disable ();
}
-int do_show_config(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_show_config(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
unsigned int reset_sample_low;
unsigned int reset_sample_high;
@@ -1091,7 +1091,7 @@ U_BOOT_CMD(
"Show Marvell strapping register (ResetSampleLow ResetSampleHigh)"
);
-int do_pldver(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_pldver(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
printf("PLD version:0x%02x\n", in_8((void *)CONFIG_SYS_PLD_VER));
diff --git a/board/esd/cpci750/sdram_init.c b/board/esd/cpci750/sdram_init.c
index 5347958085..615e32af9f 100644
--- a/board/esd/cpci750/sdram_init.c
+++ b/board/esd/cpci750/sdram_init.c
@@ -1811,7 +1811,7 @@ int set_dfcdlInit (void)
return (0);
}
-int do_show_ecc(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_show_ecc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
unsigned int ecc_counter;
unsigned int ecc_addr;
diff --git a/board/esd/cpciiser4/cpciiser4.c b/board/esd/cpciiser4/cpciiser4.c
index ee90e2c28a..dcea50ee8d 100644
--- a/board/esd/cpciiser4/cpciiser4.c
+++ b/board/esd/cpciiser4/cpciiser4.c
@@ -30,7 +30,7 @@ DECLARE_GLOBAL_DATA_PTR;
/*cmd_boot.c*/
-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[]);
extern void lxt971_no_sleep(void);
diff --git a/board/esd/dasa_sim/cmd_dasa_sim.c b/board/esd/dasa_sim/cmd_dasa_sim.c
index 675e5071d7..aa7437695e 100644
--- a/board/esd/dasa_sim/cmd_dasa_sim.c
+++ b/board/esd/dasa_sim/cmd_dasa_sim.c
@@ -204,7 +204,7 @@ static void clearPci9054 (void)
/* ------------------------------------------------------------------------- */
int do_pci9054 (cmd_tbl_t * cmdtp, int flag, int argc,
- char *argv[])
+ char * const argv[])
{
if (strcmp (argv[1], "info") == 0) {
showPci9054 ();
diff --git a/board/esd/du405/du405.c b/board/esd/du405/du405.c
index f475d11072..aa7ee92a5f 100644
--- a/board/esd/du405/du405.c
+++ b/board/esd/du405/du405.c
@@ -32,7 +32,7 @@ DECLARE_GLOBAL_DATA_PTR;
/*cmd_boot.c*/
-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[]);
extern void lxt971_no_sleep(void);
diff --git a/board/esd/du440/du440.c b/board/esd/du440/du440.c
index 111cce52a2..ba3c97c144 100644
--- a/board/esd/du440/du440.c
+++ b/board/esd/du440/du440.c
@@ -409,7 +409,7 @@ int dcf77_status(void)
return mv;
}
-int do_dcf77(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_dcf77(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int mv;
u32 pin, pinold;
@@ -490,7 +490,7 @@ int usbhub_init(void)
return ret;
}
-int do_hubinit(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_hubinit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
usbhub_init();
return 0;
@@ -573,7 +573,7 @@ int boot_eeprom_write (unsigned dev_addr,
return rcode;
}
-int do_setup_boot_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_setup_boot_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong sdsdp[4];
@@ -673,7 +673,7 @@ int eeprom_write_enable (unsigned dev_addr, int state)
return state;
}
-int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int query = argc == 1;
int state = 0;
@@ -727,7 +727,7 @@ static int pld_interrupt(u32 arg)
return rc;
}
-int do_waitpwrirq(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_waitpwrirq(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
got_pldirq = 0;
@@ -795,7 +795,7 @@ int dvi_init(void)
return ret;
}
-int do_dviinit(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_dviinit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
dvi_init();
return 0;
@@ -810,7 +810,7 @@ U_BOOT_CMD(
* TODO: 'time' command might be useful for others as well.
* Move to 'common' directory.
*/
-int do_time(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_time(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
unsigned long long start, end;
char c, cmd[CONFIG_SYS_CBSIZE];
@@ -874,7 +874,7 @@ unsigned int prng(unsigned int max)
return Y;
}
-int do_gfxdemo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_gfxdemo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
unsigned int color;
unsigned int x, y, dx, dy;
diff --git a/board/esd/hh405/hh405.c b/board/esd/hh405/hh405.c
index 4251d51b2e..ca7868cbd8 100644
--- a/board/esd/hh405/hh405.c
+++ b/board/esd/hh405/hh405.c
@@ -236,7 +236,7 @@ static const SMI_REGS init_regs_1024x768 [] =
#define FPGA_DEBUG
#endif
-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[]);
extern void lxt971_no_sleep(void);
/* fpga configuration data - gzip compressed and generated by bin2c */
@@ -733,7 +733,7 @@ int eeprom_write_enable (unsigned dev_addr, int state)
return state;
}
-int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int query = argc == 1;
int state = 0;
diff --git a/board/esd/ocrtc/cmd_ocrtc.c b/board/esd/ocrtc/cmd_ocrtc.c
index 5f3254d252..b59689b0a5 100644
--- a/board/esd/ocrtc/cmd_ocrtc.c
+++ b/board/esd/ocrtc/cmd_ocrtc.c
@@ -33,7 +33,7 @@
/*
* Set device number on pci board
*/
-int do_setdevice(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_setdevice(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int idx = 1; /* start at 1 (skip device 0) */
pci_dev_t bdf = 0;
@@ -62,7 +62,7 @@ U_BOOT_CMD(
/*
* Get device number on pci board
*/
-int do_getdevice(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_getdevice(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
u32 device;
char str[32];
diff --git a/board/esd/pci405/cmd_pci405.c b/board/esd/pci405/cmd_pci405.c
index 1d14611293..2fc9fda5d2 100644
--- a/board/esd/pci405/cmd_pci405.c
+++ b/board/esd/pci405/cmd_pci405.c
@@ -39,7 +39,7 @@ extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
/*
* Command loadpci: wait for signal from host and boot image.
*/
-int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
unsigned int *ptr = 0;
int count = 0;
diff --git a/board/esd/pci405/pci405.c b/board/esd/pci405/pci405.c
index 536485727d..b0d7663b23 100644
--- a/board/esd/pci405/pci405.c
+++ b/board/esd/pci405/pci405.c
@@ -34,7 +34,7 @@
DECLARE_GLOBAL_DATA_PTR;
/* Prototypes */
-int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
unsigned long fpga_done_state(void);
unsigned long fpga_init_state(void);
@@ -356,7 +356,7 @@ int wpeeprom(int wp)
return wp_state;
}
-int do_wpeeprom(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_wpeeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int wp = -1;
if (argc >= 2) {
diff --git a/board/esd/pf5200/pf5200.c b/board/esd/pf5200/pf5200.c
index 4e64e83bf6..83dbfcbbda 100644
--- a/board/esd/pf5200/pf5200.c
+++ b/board/esd/pf5200/pf5200.c
@@ -288,7 +288,7 @@ void power_set_reset(int power)
}
}
-int do_poweroff(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_poweroff(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
power_set_reset(1);
return (0);
@@ -325,7 +325,7 @@ int phypower(int flag)
return (status);
}
-int do_phypower(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_phypower(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
int status;
@@ -340,7 +340,7 @@ int do_phypower(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
U_BOOT_CMD(phypower, 2, 2, do_phypower,
"Switch power of ethernet phy", "");
-int do_writepci(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_writepci(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
unsigned int addr;
unsigned int size;
diff --git a/board/esd/plu405/plu405.c b/board/esd/plu405/plu405.c
index 0f7fa69a74..3a8a4cff34 100644
--- a/board/esd/plu405/plu405.c
+++ b/board/esd/plu405/plu405.c
@@ -32,7 +32,7 @@
DECLARE_GLOBAL_DATA_PTR;
-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[]);
extern void lxt971_no_sleep(void);
/* fpga configuration data - gzip compressed and generated by bin2c */
@@ -322,7 +322,7 @@ int eeprom_write_enable(unsigned dev_addr, int state)
return state;
}
-int do_eep_wren(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_eep_wren(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int query = argc == 1;
int state = 0;
diff --git a/board/esd/pmc405de/pmc405de.c b/board/esd/pmc405de/pmc405de.c
index 3725ece394..b84e08ad72 100644
--- a/board/esd/pmc405de/pmc405de.c
+++ b/board/esd/pmc405de/pmc405de.c
@@ -374,7 +374,7 @@ int eeprom_write_enable(unsigned dev_addr, int state)
return state;
}
-int do_eep_wren(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_eep_wren(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int query = argc == 1;
int state = 0;
@@ -417,7 +417,7 @@ U_BOOT_CMD(eepwren, 2, 0, do_eep_wren,
#include <environment.h>
extern env_t *env_ptr;
-int do_painit(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_painit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
u32 pram, nextbase, base;
char *v;
@@ -477,7 +477,7 @@ U_BOOT_CMD(
);
#endif /* CONFIG_PRAM */
-int do_selfreset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_selfreset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
struct ppc4xx_gpio *gpio0 = (struct ppc4xx_gpio *)GPIO_BASE;
setbits_be32(&gpio0->tcr, CONFIG_SYS_GPIO_SELFRST_N);
@@ -489,7 +489,7 @@ U_BOOT_CMD(
""
);
-int do_resetout(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_resetout(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
struct pmc405de_cpld *cpld =
(struct pmc405de_cpld *)CONFIG_SYS_CPLD_BASE;
diff --git a/board/esd/pmc440/cmd_pmc440.c b/board/esd/pmc440/cmd_pmc440.c
index 476e940962..200d7ee30d 100644
--- a/board/esd/pmc440/cmd_pmc440.c
+++ b/board/esd/pmc440/cmd_pmc440.c
@@ -67,7 +67,7 @@ int fpga_interrupt(u32 arg)
return rc;
}
-int do_waithci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_waithci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
pmc440_fpga_t *fpga = (pmc440_fpga_t *)FPGA_BA;
@@ -118,7 +118,7 @@ void dump_fifo(pmc440_fpga_t *fpga, int f, int *n)
}
}
-int do_fifo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_fifo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
pmc440_fpga_t *fpga = (pmc440_fpga_t *)FPGA_BA;
int i;
@@ -269,7 +269,7 @@ U_BOOT_CMD(
"'fifo' or 'address'"
);
-int do_setup_bootstrap_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_setup_bootstrap_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong sdsdp[5];
ulong delay;
@@ -344,7 +344,7 @@ U_BOOT_CMD(
#include <environment.h>
extern env_t *env_ptr;
-int do_painit(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_painit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
u32 pram, nextbase, base;
char *v;
@@ -404,7 +404,7 @@ U_BOOT_CMD(
);
#endif /* CONFIG_PRAM */
-int do_selfreset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_selfreset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
in_be32((void*)CONFIG_SYS_RESET_BASE);
return 0;
@@ -415,7 +415,7 @@ U_BOOT_CMD(
""
);
-int do_resetout(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_resetout(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
pmc440_fpga_t *fpga = (pmc440_fpga_t *)FPGA_BA;
@@ -452,7 +452,7 @@ U_BOOT_CMD(
""
);
-int do_inta(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_inta(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
if (is_monarch()) {
printf("This command is only supported in non-monarch mode\n");
@@ -485,7 +485,7 @@ U_BOOT_CMD(
);
/* test-only */
-int do_pmm(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_pmm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong pciaddr;
@@ -518,7 +518,7 @@ U_BOOT_CMD(
);
#if defined(CONFIG_SYS_EEPROM_WREN)
-int do_eep_wren(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_eep_wren(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int query = argc == 1;
int state = 0;
diff --git a/board/esd/tasreg/tasreg.c b/board/esd/tasreg/tasreg.c
index bd9fb2fc2b..270caac08c 100644
--- a/board/esd/tasreg/tasreg.c
+++ b/board/esd/tasreg/tasreg.c
@@ -29,7 +29,7 @@
/* Prototypes */
-int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len);
int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len);
@@ -219,7 +219,7 @@ int i2c_probe(uchar addr);
/*
*/
-int do_iploop(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_iploop(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong addr;
@@ -254,7 +254,7 @@ U_BOOT_CMD(
/*
*/
-int do_codec(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_codec(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
uchar buf[8];
@@ -307,7 +307,7 @@ U_BOOT_CMD(
/*
*/
-int do_saa(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_saa(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong addr;
ulong instr;
@@ -340,7 +340,7 @@ U_BOOT_CMD(
/*
*/
-int do_iwrite(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_iwrite(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong addr;
ulong data0;
@@ -379,7 +379,7 @@ U_BOOT_CMD(
/*
*/
-int do_iread(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_iread(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong addr;
ulong cnt;
@@ -411,7 +411,7 @@ U_BOOT_CMD(
/*
*/
-int do_ireadl(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_ireadl(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong addr;
uchar buf[32];
diff --git a/board/esd/vme8349/caddy.c b/board/esd/vme8349/caddy.c
index bda41177d9..ca8357d100 100644
--- a/board/esd/vme8349/caddy.c
+++ b/board/esd/vme8349/caddy.c
@@ -53,7 +53,7 @@ void generate_answer(struct caddy_cmd *cmd, uint32_t status, uint32_t *result)
caddy_interface->answer_in = ptr;
}
-int do_caddy(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_caddy(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
unsigned long base_addr;
uint32_t ptr;
diff --git a/board/esd/voh405/voh405.c b/board/esd/voh405/voh405.c
index a5600de6fc..6ed493ea66 100644
--- a/board/esd/voh405/voh405.c
+++ b/board/esd/voh405/voh405.c
@@ -33,7 +33,7 @@
#define FPGA_DEBUG
#endif
-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[]);
extern void lxt971_no_sleep(void);
/* fpga configuration data - gzip compressed and generated by bin2c */
@@ -356,7 +356,7 @@ int eeprom_write_enable (unsigned dev_addr, int state)
return state;
}
-int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int query = argc == 1;
int state = 0;
diff --git a/board/esd/wuh405/wuh405.c b/board/esd/wuh405/wuh405.c
index 01966eec26..704cd02702 100644
--- a/board/esd/wuh405/wuh405.c
+++ b/board/esd/wuh405/wuh405.c
@@ -32,7 +32,7 @@
#define FPGA_DEBUG
#endif
-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[]);
/* fpga configuration data - gzip compressed and generated by bin2c */
const unsigned char fpgadata[] =
OpenPOWER on IntegriCloud