Commit 4f5710f740adf8af827427ecd7d3df8619849a6b

Authored by Wolfgang Denk
1 parent ecc6aa8cf3

common/cmd_flash.c: Fix GCC 4.6 build warnings

Fix:
cmd_flash.c:355:32: warning: 'info' may be used uninitialized in this
function [-Wuninitialized]
cmd_flash.c:354:10: warning: 'sect_first' may be used uninitialized in
this function [-Wuninitialized]
cmd_flash.c:354:10: warning: 'sect_last' may be used uninitialized in
this function [-Wuninitialized]
cmd_flash.c: In function 'do_protect':
cmd_flash.c:540:9: warning: 'info' may be used uninitialized in this
function [-Wuninitialized]
cmd_flash.c:538:9: warning: 'sect_first' may be used uninitialized in
this function [-Wuninitialized]
cmd_flash.c:538:9: warning: 'sect_last' may be used uninitialized in
this function [-Wuninitialized]

Signed-off-by: Wolfgang Denk <wd@denx.de>

Showing 1 changed file with 4 additions and 4 deletions Side-by-side Diff

... ... @@ -324,9 +324,9 @@
324 324 int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
325 325 {
326 326 #ifndef CONFIG_SYS_NO_FLASH
327   - flash_info_t *info;
  327 + flash_info_t *info = NULL;
328 328 ulong bank, addr_first, addr_last;
329   - int n, sect_first, sect_last;
  329 + int n, sect_first = 0, sect_last = 0;
330 330 #if defined(CONFIG_CMD_MTDPARTS)
331 331 struct mtd_device *dev;
332 332 struct part_info *part;
333 333  
... ... @@ -457,9 +457,9 @@
457 457 {
458 458 int rcode = 0;
459 459 #ifndef CONFIG_SYS_NO_FLASH
460   - flash_info_t *info;
  460 + flash_info_t *info = NULL;
461 461 ulong bank;
462   - int i, n, sect_first, sect_last;
  462 + int i, n, sect_first = 0, sect_last = 0;
463 463 #if defined(CONFIG_CMD_MTDPARTS)
464 464 struct mtd_device *dev;
465 465 struct part_info *part;