public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] arm: Correct build error introduced by getenv_ulong() patch
@ 2011-10-24  0:14 Simon Glass
  2011-10-24  3:44 ` [U-Boot] [PATCH v2] " Simon Glass
  0 siblings, 1 reply; 21+ messages in thread
From: Simon Glass @ 2011-10-24  0:14 UTC (permalink / raw)
  To: u-boot

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>
---
 arch/arm/lib/board.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index c764844..3c147d1 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -477,6 +477,8 @@ 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;
+
 		print_size(flash_size, "");
 		/*
 		 * Compute and print flash CRC if flashchecksum is set to 'y'
@@ -566,9 +568,13 @@ 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;
+
+		s = getenv("bootfile");
+		if (s != NULL)
+			copy_filename(BootFile, s, sizeof(BootFile));
+	}
 #endif
 
 #ifdef BOARD_LATE_INIT
-- 
1.7.3.1

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2011-11-09 14:30 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-24  0:14 [U-Boot] [PATCH] arm: Correct build error introduced by getenv_ulong() patch Simon Glass
2011-10-24  3:44 ` [U-Boot] [PATCH v2] " Simon Glass
2011-10-24 19:13   ` Wolfgang Denk
2011-10-25  6:52     ` Albert ARIBAUD
2011-10-25  7:50       ` Wolfgang Denk
2011-10-25 18:21         ` Albert ARIBAUD
2011-10-25 18:26           ` Simon Glass
2011-10-25 19:36           ` Wolfgang Denk
2011-10-25 19:41             ` Simon Glass
2011-10-31  0:44   ` Mike Frysinger
2011-10-31 21:06     ` Simon Glass
2011-10-31 21:40       ` Mike Frysinger
2011-11-08  9:20         ` Detlev Zundel
2011-11-08 15:57           ` Simon Glass
2011-11-08 19:46             ` Albert ARIBAUD
2011-11-08 22:28               ` Simon Glass
2011-11-08 22:49                 ` Wolfgang Denk
2011-11-08 23:18                   ` Graeme Russ
2011-11-09 13:45                     ` Detlev Zundel
2011-11-09 14:30                       ` Simon Glass
2011-11-09 14:11                   ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox