From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Sun, 30 Oct 2011 20:44:08 -0400 Subject: [U-Boot] [PATCH v2] arm: Correct build error introduced by getenv_ulong() patch In-Reply-To: <1319427875-29965-1-git-send-email-sjg@chromium.org> References: <1319415273-3915-1-git-send-email-sjg@chromium.org> <1319427875-29965-1-git-send-email-sjg@chromium.org> Message-ID: <201110302044.09233.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sunday 23 October 2011 23:44:35 Simon Glass wrote: > --- a/arch/arm/lib/board.c > +++ b/arch/arm/lib/board.c > > 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 seems like a better solution would be to use at the top: __maybe_unused char *s; also, shouldn't these be "const char *s" ? -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20111030/d0f8df3d/attachment.pgp