diff options
author | Simon Glass <sjg@chromium.org> | 2011-10-23 17:44:35 +0000 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2011-10-24 21:13:51 +0200 |
commit | bc4e14c43c48b9c8084e177651338e4fa4938881 (patch) | |
tree | e560b7a3860bf32fcd2303a616afc5501df9b42a /arch/arm/lib | |
parent | aab773a47a8f7f40b9d7c4877853b00d22fb1347 (diff) | |
download | u-boot-imx-bc4e14c43c48b9c8084e177651338e4fa4938881.zip u-boot-imx-bc4e14c43c48b9c8084e177651338e4fa4938881.tar.gz u-boot-imx-bc4e14c43c48b9c8084e177651338e4fa4938881.tar.bz2 |
arm: Correct build error introduced by getenv_ulong() patch
Commit dc8bbea removed a local variable that is used in most ARM boards.
Since we want to avoid an 'unused variable' warning with later compilers,
and the #ifdef logic of whether this variable is required is bit painful,
this declares the variable local to the block of code that needs it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/arm/lib')
-rw-r--r-- | arch/arm/lib/board.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index c764844..7434b34 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -477,13 +477,14 @@ void board_init_r(gd_t *id, ulong dest_addr) flash_size = flash_init(); if (flash_size > 0) { # ifdef CONFIG_SYS_FLASH_CHECKSUM + char *s = getenv("flashchecksum"); + print_size(flash_size, ""); /* * Compute and print flash CRC if flashchecksum is set to 'y' * * NOTE: Maybe we should add some WATCHDOG_RESET()? XXX */ - s = getenv("flashchecksum"); if (s && (*s == 'y')) { printf(" CRC: %08X", crc32(0, (const unsigned char *) CONFIG_SYS_FLASH_BASE, @@ -566,9 +567,12 @@ void board_init_r(gd_t *id, ulong dest_addr) /* Initialize from environment */ load_addr = getenv_ulong("loadaddr", 16, load_addr); #if defined(CONFIG_CMD_NET) - s = getenv("bootfile"); - if (s != NULL) - copy_filename(BootFile, s, sizeof(BootFile)); + { + char *s = getenv("bootfile"); + + if (s != NULL) + copy_filename(BootFile, s, sizeof(BootFile)); + } #endif #ifdef BOARD_LATE_INIT |