1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-02 01:02:19 +02:00

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>
This commit is contained in:
Simon Glass
2011-10-23 17:44:35 +00:00
committed by Wolfgang Denk
parent aab773a47a
commit bc4e14c43c

View File

@@ -477,13 +477,14 @@ void board_init_r(gd_t *id, ulong dest_addr)
flash_size = flash_init(); flash_size = flash_init();
if (flash_size > 0) { if (flash_size > 0) {
# ifdef CONFIG_SYS_FLASH_CHECKSUM # ifdef CONFIG_SYS_FLASH_CHECKSUM
char *s = getenv("flashchecksum");
print_size(flash_size, ""); print_size(flash_size, "");
/* /*
* Compute and print flash CRC if flashchecksum is set to 'y' * Compute and print flash CRC if flashchecksum is set to 'y'
* *
* NOTE: Maybe we should add some WATCHDOG_RESET()? XXX * NOTE: Maybe we should add some WATCHDOG_RESET()? XXX
*/ */
s = getenv("flashchecksum");
if (s && (*s == 'y')) { if (s && (*s == 'y')) {
printf(" CRC: %08X", crc32(0, printf(" CRC: %08X", crc32(0,
(const unsigned char *) CONFIG_SYS_FLASH_BASE, (const unsigned char *) CONFIG_SYS_FLASH_BASE,
@@ -566,9 +567,12 @@ void board_init_r(gd_t *id, ulong dest_addr)
/* Initialize from environment */ /* Initialize from environment */
load_addr = getenv_ulong("loadaddr", 16, load_addr); load_addr = getenv_ulong("loadaddr", 16, load_addr);
#if defined(CONFIG_CMD_NET) #if defined(CONFIG_CMD_NET)
s = getenv("bootfile"); {
if (s != NULL) char *s = getenv("bootfile");
copy_filename(BootFile, s, sizeof(BootFile));
if (s != NULL)
copy_filename(BootFile, s, sizeof(BootFile));
}
#endif #endif
#ifdef BOARD_LATE_INIT #ifdef BOARD_LATE_INIT