Skip to contentSkip to conversation

Fix compile issue in arch/arm/lib/board.c

PATCH New Marek Vasut 3 participants 4 messages Oct 24, 2011 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix compile issue in arch/arm/lib/board.c

The commit dc8bbea0170eb2aca428ea221c91fc2e5e11f199 breaks the build of U-Boot if CONFIG_CMD_NET is enabled.

arm: Use getenv_ulong() in place of getenv(), strtoul

This changes the board code to use the new getenv_ulong() function.

Cc Simon Glass <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Albert ARIBAUD <[email protected]>
---
 arch/arm/lib/board.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/lib/board.c +1 -1
index c764844..558e973 100644
@@ -566,7 +566,7 @@ 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");
+	char *s = getenv("bootfile");
 	if (s != NULL)
 		copy_filename(BootFile, s, sizeof(BootFile));
 #endif
Signature · 1 line
1.7.6.3
#1 lore raw

PATCH 1/1 Fix compile issue in arch/arm/lib/board.c

Hello Marek,

Quoted 20 lines · Marek Vasut

The commit dc8bbea0170eb2aca428ea221c91fc2e5e11f199 breaks the build of U-Boot if CONFIG_CMD_NET is enabled.

arm: Use getenv_ulong() in place of getenv(), strtoul

This changes the board code to use the new getenv_ulong() function.

Cc Simon Glass <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Albert ARIBAUD <[email protected]>
---
 arch/arm/lib/board.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/lib/board.c +0 -0
index c764844..558e973 100644

arch/arm/lib/board.c void board_init_r(gd_t *id, ulong dest_addr) · line 569

Quoted 5 lines
arch/arm/lib/board.c +1 -1
@@ -566,7 +566,7 @@ 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");
+	char *s = getenv("bootfile");

Did you compiled this? I think, this should generate a compiler warning.

arch/arm/lib/board.c void board_init_r(gd_t *id, ulong dest_addr) · line 572

Quoted 3 lines
arch/arm/lib/board.c +0 -0
 	if (s != NULL)
 		copy_filename(BootFile, s, sizeof(BootFile));
 #endif

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#2 lore raw

PATCH 1/1 Fix compile issue in arch/arm/lib/board.c

Quoted 35 lines · Heiko Schocher

Hello Marek,

Quoted 21 lines · Marek Vasut

The commit dc8bbea0170eb2aca428ea221c91fc2e5e11f199 breaks the build of U-Boot if CONFIG_CMD_NET is enabled.

arm: Use getenv_ulong() in place of getenv(), strtoul

This changes the board code to use the new getenv_ulong() function.

Cc Simon Glass <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Albert ARIBAUD <[email protected]>

---

 arch/arm/lib/board.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/lib/board.c +0 -0
index c764844..558e973 100644

arch/arm/lib/board.c void board_init_r(gd_t *id, ulong dest_addr) · line 572

Quoted 8 lines
arch/arm/lib/board.c +1 -1
@@ -566,7 +566,7 @@ 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");
+	char *s = getenv("bootfile");

Did you compiled this? I think, this should generate a compiler warning.

Quoted 8 lines

arch/arm/lib/board.c void board_init_r(gd_t *id, ulong dest_addr) · line 572

Quoted 5 lines
arch/arm/lib/board.c +0 -0
 	if (s != NULL)
 
 		copy_filename(BootFile, s, sizeof(BootFile));
 
 #endif

bye,
Heiko

Hey Heiko,

I did and it does not. I found that on a phycore pcm037 with ELDK5. But I just replied your patch should be used ;-)

Cheers

#3 lore raw

PATCH 1/1 Fix compile issue in arch/arm/lib/board.c

In reply to Marek Vasut

Dear Marek Vasut,

Quoted 20 lines · In message <[email protected]> you wrote:

The commit dc8bbea0170eb2aca428ea221c91fc2e5e11f199 breaks the build of U-Boot if CONFIG_CMD_NET is enabled.

arm: Use getenv_ulong() in place of getenv(), strtoul

This changes the board code to use the new getenv_ulong() function.

Cc Simon Glass <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Albert ARIBAUD <[email protected]>
---
 arch/arm/lib/board.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/lib/board.c +0 -0
index c764844..558e973 100644

arch/arm/lib/board.c void board_init_r(gd_t *id, ulong dest_addr) · line 569

Quoted 5 lines
arch/arm/lib/board.c +1 -1
@@ -566,7 +566,7 @@ 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");
+	char *s = getenv("bootfile");

Never mix declarations with code.

[no need to resubmit, I applied Simon's patch instead.]

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If all you have is a hammer, everything looks like a nail.