public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number
@ 2011-10-14  0:43 Simon Glass
  2011-10-14  0:43 ` [U-Boot] [PATCH 01/10] Add getenv_int() to read an integer from an environment variable Simon Glass
                   ` (10 more replies)
  0 siblings, 11 replies; 54+ messages in thread
From: Simon Glass @ 2011-10-14  0:43 UTC (permalink / raw)
  To: u-boot

Several places in U-Boot's board files can make use of a function like this,
so this patch series creates the function, and changes the board files to
use it.

As suggested by Mike Frysinger <vapier@gentoo.org>.


Simon Glass (10):
  Add getenv_int() to read an integer from an environment variable
  arm: Use getenv_ulong() in place of getenv(), strtoul
  avr32: Use getenv_ulong() in place of getenv(), strtoul
  blackfin: Use getenv_ulong() in place of getenv(), strtoul
  m68k: Use getenv_ulong() in place of getenv(), strtoul
  microblaze: Use getenv_ulong() in place of getenv(), strtoul
  mips: Use getenv_ulong() in place of getenv(), strtoul
  powerpc: Use getenv_ulong() in place of getenv(), strtoul
  sparc: Use getenv_ulong() in place of getenv(), strtoul
  x86: Use getenv_ulong() in place of getenv(), strtoul

 arch/arm/lib/board.c        |   36 +++++++++++-------------------------
 arch/avr32/lib/board.c      |   16 +++-------------
 arch/blackfin/lib/board.c   |    9 ++-------
 arch/m68k/lib/board.c       |   33 ++++++++-------------------------
 arch/microblaze/lib/board.c |    6 ++----
 arch/mips/lib/board.c       |   14 +++-----------
 arch/powerpc/lib/board.c    |   33 ++++++++-------------------------
 arch/sparc/lib/board.c      |   13 +++----------
 arch/x86/lib/board.c        |   14 +++-----------
 common/cmd_nvedit.c         |    7 +++++++
 include/common.h            |   12 ++++++++++++
 11 files changed, 62 insertions(+), 131 deletions(-)

-- 
1.7.3.1

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

* [U-Boot] [PATCH 01/10] Add getenv_int() to read an integer from an environment variable
  2011-10-14  0:43 [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number Simon Glass
@ 2011-10-14  0:43 ` Simon Glass
  2011-10-14  1:53   ` Mike Frysinger
  2011-10-14 19:29   ` Wolfgang Denk
  2011-10-14  0:43 ` [U-Boot] [PATCH 02/10] arm: Use getenv_ulong() in place of getenv(), strtoul Simon Glass
                   ` (9 subsequent siblings)
  10 siblings, 2 replies; 54+ messages in thread
From: Simon Glass @ 2011-10-14  0:43 UTC (permalink / raw)
  To: u-boot

This is not an uncommon operation in U-Boot, so let's put it in a common
function.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 common/cmd_nvedit.c |    7 +++++++
 include/common.h    |   12 ++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 101bc49..337ae9a 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -540,6 +540,13 @@ int getenv_f(const char *name, char *buf, unsigned len)
 	return -1;
 }
 
+ulong getenv_ulong(const char *name, int base, ulong default_val)
+{
+	const char *str = getenv(name);
+
+	return str ? simple_strtoul(str, NULL, base) : default_val;
+}
+
 #if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_ENV_IS_NOWHERE)
 
 int do_env_save(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
diff --git a/include/common.h b/include/common.h
index eb19a44..c2796e2 100644
--- a/include/common.h
+++ b/include/common.h
@@ -288,6 +288,18 @@ void	env_relocate (void);
 int	envmatch     (uchar *, int);
 char	*getenv	     (const char *);
 int	getenv_f     (const char *name, char *buf, unsigned len);
+
+/**
+ * Decode the value of an environment variable and return it.
+ *
+ * @param name		Name of environemnt variable
+ * @param base		Number base to use (normally 10, or 16 for hex)
+ * @param default_val	Default value to return if the variable is not
+ *			found
+ * @return the decoded value, or default_val if not found
+ */
+ulong getenv_ulong(const char *name, int base, ulong default_val);
+
 int	saveenv	     (void);
 #ifdef CONFIG_PPC		/* ARM version to be fixed! */
 int inline setenv    (const char *, const char *);
-- 
1.7.3.1

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

* [U-Boot] [PATCH 02/10] arm: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number Simon Glass
  2011-10-14  0:43 ` [U-Boot] [PATCH 01/10] Add getenv_int() to read an integer from an environment variable Simon Glass
@ 2011-10-14  0:43 ` Simon Glass
  2011-10-23 20:50   ` Wolfgang Denk
                     ` (2 more replies)
  2011-10-14  0:43 ` [U-Boot] [PATCH 03/10] avr32: Use getenv_ulong() in place of getenv(), strtoul Simon Glass
                   ` (8 subsequent siblings)
  10 siblings, 3 replies; 54+ messages in thread
From: Simon Glass @ 2011-10-14  0:43 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 arch/arm/lib/board.c |   36 +++++++++++-------------------------
 1 files changed, 11 insertions(+), 25 deletions(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 1fe3751..c764844 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -118,16 +118,11 @@ void blue_led_off(void) __attribute__((weak, alias("__blue_led_off")));
 #if defined(CONFIG_ARM_DCC) && !defined(CONFIG_BAUDRATE)
 #define CONFIG_BAUDRATE 115200
 #endif
+
 static int init_baudrate(void)
 {
-	char tmp[64];	/* long enough for environment variables */
-	int i = getenv_f("baudrate", tmp, sizeof(tmp));
-
-	gd->baudrate = (i > 0)
-			? (int) simple_strtoul(tmp, NULL, 10)
-			: CONFIG_BAUDRATE;
-
-	return (0);
+	gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE);
+	return 0;
 }
 
 static int display_banner(void)
@@ -267,6 +262,9 @@ void board_init_f(ulong bootflag)
 	init_fnc_t **init_fnc_ptr;
 	gd_t *id;
 	ulong addr, addr_sp;
+#ifdef CONFIG_PRAM
+	ulong reg;
+#endif
 
 	/* Pointer is writable since we allocated a register for it */
 	gd = (gd_t *) ((CONFIG_SYS_INIT_SP_ADDR) & ~0x07);
@@ -317,9 +315,7 @@ void board_init_f(ulong bootflag)
 	/*
 	 * reserve protected RAM
 	 */
-	i = getenv_r("pram", (char *)tmp, sizeof(tmp));
-	reg = (i > 0) ? simple_strtoul((const char *)tmp, NULL, 10) :
-		CONFIG_PRAM;
+	reg = getenv_ulong("pram", 10, CONFIG_PRAM);
 	addr -= (reg << 10);		/* size is in kB */
 	debug("Reserving %ldk for protected RAM at %08lx\n", reg, addr);
 #endif /* CONFIG_PRAM */
@@ -441,7 +437,6 @@ static char *failed = "*** failed ***\n";
 
 void board_init_r(gd_t *id, ulong dest_addr)
 {
-	char *s;
 	ulong malloc_start;
 #if !defined(CONFIG_SYS_NO_FLASH)
 	ulong flash_size;
@@ -569,9 +564,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
 #endif /* CONFIG_DRIVER_SMC91111 || CONFIG_DRIVER_LAN91C96 */
 
 	/* Initialize from environment */
-	s = getenv("loadaddr");
-	if (s != NULL)
-		load_addr = simple_strtoul(s, NULL, 16);
+	load_addr = getenv_ulong("loadaddr", 16, load_addr);
 #if defined(CONFIG_CMD_NET)
 	s = getenv("bootfile");
 	if (s != NULL)
@@ -604,18 +597,11 @@ void board_init_r(gd_t *id, ulong dest_addr)
 	 * taking into account the protected RAM@top of memory
 	 */
 	{
-		ulong pram;
+		ulong pram = 0;
 		uchar memsz[32];
-#ifdef CONFIG_PRAM
-		char *s;
 
-		s = getenv("pram");
-		if (s != NULL)
-			pram = simple_strtoul(s, NULL, 10);
-		else
-			pram = CONFIG_PRAM;
-#else
-		pram = 0;
+#ifdef CONFIG_PRAM
+		pram = getenv_ulong("pram", 10, CONFIG_PRAM);
 #endif
 #ifdef CONFIG_LOGBUFFER
 #ifndef CONFIG_ALT_LB_ADDR
-- 
1.7.3.1

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

* [U-Boot] [PATCH 03/10] avr32: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number Simon Glass
  2011-10-14  0:43 ` [U-Boot] [PATCH 01/10] Add getenv_int() to read an integer from an environment variable Simon Glass
  2011-10-14  0:43 ` [U-Boot] [PATCH 02/10] arm: Use getenv_ulong() in place of getenv(), strtoul Simon Glass
@ 2011-10-14  0:43 ` Simon Glass
  2011-10-23 20:50   ` Wolfgang Denk
  2011-10-14  0:43 ` [U-Boot] [PATCH 04/10] blackfin: " Simon Glass
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 54+ messages in thread
From: Simon Glass @ 2011-10-14  0:43 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 arch/avr32/lib/board.c |   16 +++-------------
 1 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
index 3e1cc0d..63fe297 100644
--- a/arch/avr32/lib/board.c
+++ b/arch/avr32/lib/board.c
@@ -95,19 +95,10 @@ static inline void dma_alloc_init(void)
 
 static int init_baudrate(void)
 {
-	char tmp[64];
-	int i;
-
-	i = getenv_f("baudrate", tmp, sizeof(tmp));
-	if (i > 0) {
-		gd->baudrate = simple_strtoul(tmp, NULL, 10);
-	} else {
-		gd->baudrate = CONFIG_BAUDRATE;
-	}
+	gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE);
 	return 0;
 }
 
-
 static int display_banner (void)
 {
 	printf ("\n\n%s\n\n", version_string);
@@ -319,9 +310,8 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
 	jumptable_init();
 	console_init_r();
 
-	s = getenv("loadaddr");
-	if (s)
-		load_addr = simple_strtoul(s, NULL, 16);
+	/* Initialize from environment */
+	load_addr = getenv_ulong("loadaddr", 16, load_addr);
 
 #ifdef CONFIG_BITBANGMII
 	bb_miiphy_init();
-- 
1.7.3.1

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

* [U-Boot] [PATCH 04/10] blackfin: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number Simon Glass
                   ` (2 preceding siblings ...)
  2011-10-14  0:43 ` [U-Boot] [PATCH 03/10] avr32: Use getenv_ulong() in place of getenv(), strtoul Simon Glass
@ 2011-10-14  0:43 ` Simon Glass
  2011-10-14  1:54   ` Mike Frysinger
  2011-10-23 20:50   ` Wolfgang Denk
  2011-10-14  0:43 ` [U-Boot] [PATCH 05/10] m68k: " Simon Glass
                   ` (6 subsequent siblings)
  10 siblings, 2 replies; 54+ messages in thread
From: Simon Glass @ 2011-10-14  0:43 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 arch/blackfin/lib/board.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index bfdb586..a70473c 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -62,11 +62,7 @@ static int display_banner(void)
 
 static int init_baudrate(void)
 {
-	char baudrate[15];
-	int i = getenv_f("baudrate", baudrate, sizeof(baudrate));
-	gd->bd->bi_baudrate = gd->baudrate = (i > 0)
-	    ? simple_strtoul(baudrate, NULL, 10)
-	    : CONFIG_BAUDRATE;
+	gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE);
 	return 0;
 }
 
@@ -374,8 +370,7 @@ void board_init_r(gd_t * id, ulong dest_addr)
 #endif
 
 	/* Initialize from environment */
-	if ((s = getenv("loadaddr")) != NULL)
-		load_addr = simple_strtoul(s, NULL, 16);
+	load_addr = getenv_ulong("loadaddr", 16, load_addr);
 
 #if defined(CONFIG_MISC_INIT_R)
 	/* miscellaneous platform dependent initialisations */
-- 
1.7.3.1

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

* [U-Boot] [PATCH 05/10] m68k: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number Simon Glass
                   ` (3 preceding siblings ...)
  2011-10-14  0:43 ` [U-Boot] [PATCH 04/10] blackfin: " Simon Glass
@ 2011-10-14  0:43 ` Simon Glass
  2011-10-23 20:51   ` Wolfgang Denk
  2011-10-14  0:43 ` [U-Boot] [PATCH 06/10] microblaze: " Simon Glass
                   ` (5 subsequent siblings)
  10 siblings, 1 reply; 54+ messages in thread
From: Simon Glass @ 2011-10-14  0:43 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 arch/m68k/lib/board.c |   33 ++++++++-------------------------
 1 files changed, 8 insertions(+), 25 deletions(-)

diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c
index b9ccb64..259b71c 100644
--- a/arch/m68k/lib/board.c
+++ b/arch/m68k/lib/board.c
@@ -119,13 +119,8 @@ typedef int (init_fnc_t) (void);
 
 static int init_baudrate (void)
 {
-	char tmp[64];	/* long enough for environment variables */
-	int i = getenv_f("baudrate", tmp, sizeof (tmp));
-
-	gd->baudrate = (i > 0)
-			? (int) simple_strtoul (tmp, NULL, 10)
-			: CONFIG_BAUDRATE;
-	return (0);
+	gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE);
+	return 0;
 }
 
 /***********************************************************************/
@@ -221,9 +216,7 @@ board_init_f (ulong bootflag)
 	gd_t *id;
 	init_fnc_t **init_fnc_ptr;
 #ifdef CONFIG_PRAM
-	int i;
 	ulong reg;
-	char tmp[64];		/* long enough for environment variables */
 #endif
 
 	/* Pointer is writable since we allocated a register for it */
@@ -264,8 +257,7 @@ board_init_f (ulong bootflag)
 	/*
 	 * reserve protected RAM
 	 */
-	i = getenv_f("pram", tmp, sizeof (tmp));
-	reg = (i > 0) ? simple_strtoul (tmp, NULL, 10) : CONFIG_PRAM;
+	reg = getenv_ulong("pram", 10, CONFIG_PRAM);
 	addr -= (reg << 10);		/* size is in kB */
 	debug ("Reserving %ldk for protected RAM at %08lx\n", reg, addr);
 #endif /* CONFIG_PRAM */
@@ -575,9 +567,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
 	/* Insert function pointers now that we have relocated the code */
 
 	/* Initialize from environment */
-	if ((s = getenv ("loadaddr")) != NULL) {
-		load_addr = simple_strtoul (s, NULL, 16);
-	}
+	load_addr = getenv_ulong("loadaddr", 16, load_addr);
 #if defined(CONFIG_CMD_NET)
 	if ((s = getenv ("bootfile")) != NULL) {
 		copy_filename (BootFile, s, sizeof (BootFile));
@@ -648,18 +638,11 @@ void board_init_r (gd_t *id, ulong dest_addr)
 	 * taking into account the protected RAM@top of memory
 	 */
 	{
-		ulong pram;
-		char memsz[32];
-#ifdef CONFIG_PRAM
-		char *s;
+		ulong pram = 0;
+		uchar memsz[32];
 
-		if ((s = getenv ("pram")) != NULL) {
-			pram = simple_strtoul (s, NULL, 10);
-		} else {
-			pram = CONFIG_PRAM;
-		}
-#else
-		pram=0;
+#ifdef CONFIG_PRAM
+		pram = getenv_ulong("pram", 10, CONFIG_PRAM);
 #endif
 #ifdef CONFIG_LOGBUFFER
 		/* Also take the logbuffer into account (pram is in kB) */
-- 
1.7.3.1

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

* [U-Boot] [PATCH 06/10] microblaze: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number Simon Glass
                   ` (4 preceding siblings ...)
  2011-10-14  0:43 ` [U-Boot] [PATCH 05/10] m68k: " Simon Glass
@ 2011-10-14  0:43 ` Simon Glass
  2011-10-23 20:52   ` Wolfgang Denk
  2011-10-14  0:43 ` [U-Boot] [PATCH 07/10] mips: " Simon Glass
                   ` (4 subsequent siblings)
  10 siblings, 1 reply; 54+ messages in thread
From: Simon Glass @ 2011-10-14  0:43 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 arch/microblaze/lib/board.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index d97543b..c595cb9 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -160,10 +160,8 @@ void board_init (void)
 	/* Initialize stdio devices */
 	stdio_init ();
 
-	if ((s = getenv ("loadaddr")) != NULL) {
-		load_addr = simple_strtoul (s, NULL, 16);
-	}
-
+	/* Initialize from environment */
+	load_addr = getenv_ulong("loadaddr", 16, load_addr);
 #if defined(CONFIG_CMD_NET)
 	/* IP Address */
 	bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-- 
1.7.3.1

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

* [U-Boot] [PATCH 07/10] mips: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number Simon Glass
                   ` (5 preceding siblings ...)
  2011-10-14  0:43 ` [U-Boot] [PATCH 06/10] microblaze: " Simon Glass
@ 2011-10-14  0:43 ` Simon Glass
  2011-10-23 20:52   ` Wolfgang Denk
  2011-10-14  0:43 ` [U-Boot] [PATCH 08/10] powerpc: " Simon Glass
                   ` (3 subsequent siblings)
  10 siblings, 1 reply; 54+ messages in thread
From: Simon Glass @ 2011-10-14  0:43 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 arch/mips/lib/board.c |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index cc75d3f..1274d63 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -101,14 +101,8 @@ static void display_flash_config(ulong size)
 
 static int init_baudrate (void)
 {
-	char tmp[64];	/* long enough for environment variables */
-	int i = getenv_f("baudrate", tmp, sizeof (tmp));
-
-	gd->baudrate = (i > 0)
-			? (int) simple_strtoul (tmp, NULL, 10)
-			: CONFIG_BAUDRATE;
-
-	return (0);
+	gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE);
+	return 0;
 }
 
 
@@ -348,9 +342,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
 /** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/
 
 	/* Initialize from environment */
-	if ((s = getenv ("loadaddr")) != NULL) {
-		load_addr = simple_strtoul (s, NULL, 16);
-	}
+	load_addr = getenv_ulong("loadaddr", 16, load_addr);
 #if defined(CONFIG_CMD_NET)
 	if ((s = getenv ("bootfile")) != NULL) {
 		copy_filename (BootFile, s, sizeof (BootFile));
-- 
1.7.3.1

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

* [U-Boot] [PATCH 08/10] powerpc: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number Simon Glass
                   ` (6 preceding siblings ...)
  2011-10-14  0:43 ` [U-Boot] [PATCH 07/10] mips: " Simon Glass
@ 2011-10-14  0:43 ` Simon Glass
  2011-10-14  6:04   ` Stefan Roese
                     ` (2 more replies)
  2011-10-14  0:43 ` [U-Boot] [PATCH 09/10] sparc: Use getenv_ulong() in place of getenv(), strtoul Simon Glass
                   ` (2 subsequent siblings)
  10 siblings, 3 replies; 54+ messages in thread
From: Simon Glass @ 2011-10-14  0:43 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 arch/powerpc/lib/board.c |   33 ++++++++-------------------------
 1 files changed, 8 insertions(+), 25 deletions(-)

diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index 4fd0149..f7325c8 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -158,13 +158,8 @@ typedef int (init_fnc_t) (void);
 
 static int init_baudrate (void)
 {
-	char tmp[64];	/* long enough for environment variables */
-	int i = getenv_f("baudrate", tmp, sizeof (tmp));
-
-	gd->baudrate = (i > 0)
-			? (int) simple_strtoul (tmp, NULL, 10)
-			: CONFIG_BAUDRATE;
-	return (0);
+	gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE);
+	return 0;
 }
 
 /***********************************************************************/
@@ -374,9 +369,7 @@ void board_init_f (ulong bootflag)
 	gd_t *id;
 	init_fnc_t **init_fnc_ptr;
 #ifdef CONFIG_PRAM
-	int i;
 	ulong reg;
-	uchar tmp[64];		/* long enough for environment variables */
 #endif
 
 	/* Pointer is writable since we allocated a register for it */
@@ -448,10 +441,9 @@ void board_init_f (ulong bootflag)
 	/*
 	 * reserve protected RAM
 	 */
-	i = getenv_f("pram", (char *)tmp, sizeof (tmp));
-	reg = (i > 0) ? simple_strtoul ((const char *)tmp, NULL, 10) : CONFIG_PRAM;
+	reg = getenv_ulong("pram", 10, CONFIG_PRAM);
 	addr -= (reg << 10);		/* size is in kB */
-	debug ("Reserving %ldk for protected RAM at %08lx\n", reg, addr);
+	debug("Reserving %ldk for protected RAM at %08lx\n", reg, addr);
 #endif /* CONFIG_PRAM */
 
 	/* round down to next 4 kB limit */
@@ -933,9 +925,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
 	udelay (20);
 
 	/* Initialize from environment */
-	if ((s = getenv ("loadaddr")) != NULL) {
-		load_addr = simple_strtoul (s, NULL, 16);
-	}
+	load_addr = getenv_ulong("loadaddr", 16, load_addr);
 #if defined(CONFIG_CMD_NET)
 	if ((s = getenv ("bootfile")) != NULL) {
 		copy_filename (BootFile, s, sizeof (BootFile));
@@ -1018,18 +1008,11 @@ void board_init_r (gd_t *id, ulong dest_addr)
 	 * taking into account the protected RAM@top of memory
 	 */
 	{
-		ulong pram;
+		ulong pram = 0;
 		uchar memsz[32];
-#ifdef CONFIG_PRAM
-		char *s;
 
-		if ((s = getenv ("pram")) != NULL) {
-			pram = simple_strtoul (s, NULL, 10);
-		} else {
-			pram = CONFIG_PRAM;
-		}
-#else
-		pram=0;
+#ifdef CONFIG_PRAM
+		pram = getenv_ulong("pram", 10, CONFIG_PRAM);
 #endif
 #ifdef CONFIG_LOGBUFFER
 #ifndef CONFIG_ALT_LB_ADDR
-- 
1.7.3.1

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

* [U-Boot] [PATCH 09/10] sparc: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number Simon Glass
                   ` (7 preceding siblings ...)
  2011-10-14  0:43 ` [U-Boot] [PATCH 08/10] powerpc: " Simon Glass
@ 2011-10-14  0:43 ` Simon Glass
  2011-10-23 20:53   ` Wolfgang Denk
  2011-10-14  0:43 ` [U-Boot] [PATCH 10/10] x86: " Simon Glass
  2011-10-14  6:13 ` [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number Reinhard Meyer
  10 siblings, 1 reply; 54+ messages in thread
From: Simon Glass @ 2011-10-14  0:43 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 arch/sparc/lib/board.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/arch/sparc/lib/board.c b/arch/sparc/lib/board.c
index af4f035..69b5ca4 100644
--- a/arch/sparc/lib/board.c
+++ b/arch/sparc/lib/board.c
@@ -87,13 +87,8 @@ ulong monitor_flash_len;
 
 static int init_baudrate(void)
 {
-	char tmp[64];		/* long enough for environment variables */
-	int i = getenv_f("baudrate", tmp, sizeof(tmp));
-
-	gd->baudrate = (i > 0)
-	    ? (int)simple_strtoul(tmp, NULL, 10)
-	    : CONFIG_BAUDRATE;
-	return (0);
+	gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE);
+	return 0;
 }
 
 /***********************************************************************/
@@ -366,9 +361,7 @@ void board_init_f(ulong bootflag)
 	udelay(20);
 
 	/* Initialize from environment */
-	if ((s = getenv("loadaddr")) != NULL) {
-		load_addr = simple_strtoul(s, NULL, 16);
-	}
+	load_addr = getenv_ulong("loadaddr", 16, load_addr);
 #if defined(CONFIG_CMD_NET)
 	if ((s = getenv("bootfile")) != NULL) {
 		copy_filename(BootFile, s, sizeof(BootFile));
-- 
1.7.3.1

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

* [U-Boot] [PATCH 10/10] x86: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number Simon Glass
                   ` (8 preceding siblings ...)
  2011-10-14  0:43 ` [U-Boot] [PATCH 09/10] sparc: Use getenv_ulong() in place of getenv(), strtoul Simon Glass
@ 2011-10-14  0:43 ` Simon Glass
  2011-10-23 20:53   ` Wolfgang Denk
  2011-10-14  6:13 ` [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number Reinhard Meyer
  10 siblings, 1 reply; 54+ messages in thread
From: Simon Glass @ 2011-10-14  0:43 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 arch/x86/lib/board.c |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index 2309e00..8963580 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -74,14 +74,8 @@ extern ulong __bss_end;
  */
 static int init_baudrate (void)
 {
-	char tmp[64];	/* long enough for environment variables */
-	int i = getenv_f("baudrate", tmp, 64);
-
-	gd->baudrate = (i != 0)
-			? (int) simple_strtoul (tmp, NULL, 10)
-			: CONFIG_BAUDRATE;
-
-	return (0);
+	gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE);
+	return 0;
 }
 
 static int display_banner (void)
@@ -360,9 +354,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
 	udelay(20);
 
 	/* Initialize from environment */
-	if ((s = getenv ("loadaddr")) != NULL) {
-		load_addr = simple_strtoul (s, NULL, 16);
-	}
+	load_addr = getenv_ulong("loadaddr", 16, load_addr);
 #if defined(CONFIG_CMD_NET)
 	if ((s = getenv ("bootfile")) != NULL) {
 		copy_filename (BootFile, s, sizeof (BootFile));
-- 
1.7.3.1

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

* [U-Boot] [PATCH 01/10] Add getenv_int() to read an integer from an environment variable
  2011-10-14  0:43 ` [U-Boot] [PATCH 01/10] Add getenv_int() to read an integer from an environment variable Simon Glass
@ 2011-10-14  1:53   ` Mike Frysinger
  2011-10-14 16:47     ` Simon Glass
  2011-10-14 19:29   ` Wolfgang Denk
  1 sibling, 1 reply; 54+ messages in thread
From: Mike Frysinger @ 2011-10-14  1:53 UTC (permalink / raw)
  To: u-boot

subject is "int" but implementation is "ulong"
-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/20111013/4848fc55/attachment.pgp 

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

* [U-Boot] [PATCH 04/10] blackfin: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 ` [U-Boot] [PATCH 04/10] blackfin: " Simon Glass
@ 2011-10-14  1:54   ` Mike Frysinger
  2011-10-23 20:50   ` Wolfgang Denk
  1 sibling, 0 replies; 54+ messages in thread
From: Mike Frysinger @ 2011-10-14  1:54 UTC (permalink / raw)
  To: u-boot

Acked-by: Mike Frysinger <vapier@gentoo.org>
-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/20111013/b7e218e3/attachment.pgp 

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

* [U-Boot] [PATCH 08/10] powerpc: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 ` [U-Boot] [PATCH 08/10] powerpc: " Simon Glass
@ 2011-10-14  6:04   ` Stefan Roese
  2011-10-23 20:53   ` Wolfgang Denk
  2011-10-23 21:58   ` [U-Boot] [PATCH] arch/powerpc/lib/board.c: fix build warning Wolfgang Denk
  2 siblings, 0 replies; 54+ messages in thread
From: Stefan Roese @ 2011-10-14  6:04 UTC (permalink / raw)
  To: u-boot

On Friday 14 October 2011 02:43:12 Simon Glass wrote:
> This changes the board code to use the new getenv_ulong() function.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>

Nice patch series. Thanks.

Acked-by: Stefan Roese <sr@denx.de>

Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

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

* [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number
  2011-10-14  0:43 [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number Simon Glass
                   ` (9 preceding siblings ...)
  2011-10-14  0:43 ` [U-Boot] [PATCH 10/10] x86: " Simon Glass
@ 2011-10-14  6:13 ` Reinhard Meyer
  2011-10-14 14:31   ` Simon Glass
  10 siblings, 1 reply; 54+ messages in thread
From: Reinhard Meyer @ 2011-10-14  6:13 UTC (permalink / raw)
  To: u-boot

Dear Simon Glass,
> Several places in U-Boot's board files can make use of a function like this,
> so this patch series creates the function, and changes the board files to
> use it.
>
> As suggested by Mike Frysinger<vapier@gentoo.org>.
>
>
> Simon Glass (10):
>    Add getenv_int() to read an integer from an environment variable

Just a question (I cannot dig deep into this):

Since getenv_* might be used before relocation (it is for baudrate, am I right?),
and I cannot see how getenv_int() would work before relocation.

And why do you mention getenv_int but implement getenv_long?

Best Regards,
Reinhard

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

* [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number
  2011-10-14  6:13 ` [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number Reinhard Meyer
@ 2011-10-14 14:31   ` Simon Glass
  2011-10-14 17:11     ` Mike Frysinger
  2011-10-14 19:27     ` Wolfgang Denk
  0 siblings, 2 replies; 54+ messages in thread
From: Simon Glass @ 2011-10-14 14:31 UTC (permalink / raw)
  To: u-boot

Hi Reinhard,

On Thu, Oct 13, 2011 at 11:13 PM, Reinhard Meyer
<u-boot@emk-elektronik.de> wrote:
> Dear Simon Glass,
>>
>> Several places in U-Boot's board files can make use of a function like
>> this,
>> so this patch series creates the function, and changes the board files to
>> use it.
>>
>> As suggested by Mike Frysinger<vapier@gentoo.org>.
>>
>>
>> Simon Glass (10):
>> ? Add getenv_int() to read an integer from an environment variable
>
> Just a question (I cannot dig deep into this):
>
> Since getenv_* might be used before relocation (it is for baudrate, am I
> right?),
> and I cannot see how getenv_int() would work before relocation.

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

* [U-Boot] [PATCH 01/10] Add getenv_int() to read an integer from an environment variable
  2011-10-14  1:53   ` Mike Frysinger
@ 2011-10-14 16:47     ` Simon Glass
  2011-10-14 17:09       ` Mike Frysinger
  0 siblings, 1 reply; 54+ messages in thread
From: Simon Glass @ 2011-10-14 16:47 UTC (permalink / raw)
  To: u-boot

Hi Mike,

On Thu, Oct 13, 2011 at 6:53 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> subject is "int" but implementation is "ulong"
> -mike
>

Yes - I wonder if I can just submit a V2 for that one patch with a new subject?

Regards,
Simon

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

* [U-Boot] [PATCH 01/10] Add getenv_int() to read an integer from an environment variable
  2011-10-14 16:47     ` Simon Glass
@ 2011-10-14 17:09       ` Mike Frysinger
  2011-10-14 17:42         ` Simon Glass
  0 siblings, 1 reply; 54+ messages in thread
From: Mike Frysinger @ 2011-10-14 17:09 UTC (permalink / raw)
  To: u-boot

On Friday 14 October 2011 12:47:56 Simon Glass wrote:
> On Thu, Oct 13, 2011 at 6:53 PM, Mike Frysinger wrote:
> > subject is "int" but implementation is "ulong"
> 
> Yes - I wonder if I can just submit a V2 for that one patch with a new
> subject?

that's fine (i do it all the time).  although in the future, your v2 should 
probably have the reply-to field set to the v1 patch.
-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/20111014/7ece226f/attachment.pgp 

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

* [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number
  2011-10-14 14:31   ` Simon Glass
@ 2011-10-14 17:11     ` Mike Frysinger
  2011-10-14 19:30       ` Wolfgang Denk
  2011-10-14 19:27     ` Wolfgang Denk
  1 sibling, 1 reply; 54+ messages in thread
From: Mike Frysinger @ 2011-10-14 17:11 UTC (permalink / raw)
  To: u-boot

On Friday 14 October 2011 10:31:12 Simon Glass wrote:
> On Thu, Oct 13, 2011 at 11:13 PM, Reinhard Meyer wrote:
> >> Several places in U-Boot's board files can make use of a function like
> >> this,
> >> so this patch series creates the function, and changes the board files
> >> to use it.
> >> 
> >> As suggested by Mike Frysinger<vapier@gentoo.org>.
> >> 
> >> 
> >> Simon Glass (10):
> >>   Add getenv_int() to read an integer from an environment variable
> > 
> > Just a question (I cannot dig deep into this):
> > 
> > Since getenv_* might be used before relocation (it is for baudrate, am I
> > right?),
> > and I cannot see how getenv_int() would work before relocation.
> 
> From what I can tell the existing getenv() function deals with this
> automatically by looking at the global flags.

yep, and that should be sufficient.  in the pre-relocation stages, you can only 
have one active getenv() at a time, but that isn't anything new, and in this 
particular case, it's fine.

if people need an explicit getenv_ulong_r() in the future, we can wait for 
someone else to propose that.  but i think it unlikely.
-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/20111014/df45a9d7/attachment.pgp 

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

* [U-Boot] [PATCH 01/10] Add getenv_int() to read an integer from an environment variable
  2011-10-14 17:09       ` Mike Frysinger
@ 2011-10-14 17:42         ` Simon Glass
  2011-10-14 18:06           ` Mike Frysinger
  0 siblings, 1 reply; 54+ messages in thread
From: Simon Glass @ 2011-10-14 17:42 UTC (permalink / raw)
  To: u-boot

Hi Mike,

On Fri, Oct 14, 2011 at 10:09 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Friday 14 October 2011 12:47:56 Simon Glass wrote:
>> On Thu, Oct 13, 2011 at 6:53 PM, Mike Frysinger wrote:
>> > subject is "int" but implementation is "ulong"
>>
>> Yes - I wonder if I can just submit a V2 for that one patch with a new
>> subject?
>
> that's fine (i do it all the time). ?although in the future, your v2 should
> probably have the reply-to field set to the v1 patch.
> -mike
>

OK I need to figure out how to do that with git send-email. I can see
how to do it with a single email, but I suppose if I post a V2 then
every email should be in reply to its corresponding V1, is that right?

BTW I also need some patchwork automation since a lot of the patches
marked 'NEW' in there are not - 'pwclient update' is most of it I
suppose, if it had an option to get my password back - no reply to
this:

http://lists.ozlabs.org/pipermail/patchwork/2010-December/000347.html

Regards,
Simon

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

* [U-Boot] [PATCH 01/10] Add getenv_int() to read an integer from an environment variable
  2011-10-14 17:42         ` Simon Glass
@ 2011-10-14 18:06           ` Mike Frysinger
  2011-10-14 18:15             ` Simon Glass
  0 siblings, 1 reply; 54+ messages in thread
From: Mike Frysinger @ 2011-10-14 18:06 UTC (permalink / raw)
  To: u-boot

On Friday 14 October 2011 13:42:07 Simon Glass wrote:
> On Fri, Oct 14, 2011 at 10:09 AM, Mike Frysinger wrote:
> > On Friday 14 October 2011 12:47:56 Simon Glass wrote:
> >> On Thu, Oct 13, 2011 at 6:53 PM, Mike Frysinger wrote:
> >> > subject is "int" but implementation is "ulong"
> >> 
> >> Yes - I wonder if I can just submit a V2 for that one patch with a new
> >> subject?
> > 
> > that's fine (i do it all the time).  although in the future, your v2
> > should probably have the reply-to field set to the v1 patch.
> 
> OK I need to figure out how to do that with git send-email. I can see
> how to do it with a single email, but I suppose if I post a V2 then
> every email should be in reply to its corresponding V1, is that right?

if you send out a whole new patchseries, i don't think each sub patch should 
be a reply to the original.  having it be a new tree by itself is fine.

> BTW I also need some patchwork automation since a lot of the patches
> marked 'NEW' in there are not - 'pwclient update' is most of it I
> suppose, if it had an option to get my password back - no reply to
> this:
> 
> http://lists.ozlabs.org/pipermail/patchwork/2010-December/000347.html

i've only used the web interface so far.  and this extension makes life a lot 
easier when you have to select a lot (but not all) of the patches in a query:
https://chrome.google.com/webstore/detail/ldopaogbegnhconlboidfjcmidndkbeg
-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/20111014/710ec37c/attachment.pgp 

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

* [U-Boot] [PATCH 01/10] Add getenv_int() to read an integer from an environment variable
  2011-10-14 18:06           ` Mike Frysinger
@ 2011-10-14 18:15             ` Simon Glass
  0 siblings, 0 replies; 54+ messages in thread
From: Simon Glass @ 2011-10-14 18:15 UTC (permalink / raw)
  To: u-boot

Hi Mike,

On Fri, Oct 14, 2011 at 11:06 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Friday 14 October 2011 13:42:07 Simon Glass wrote:
>> On Fri, Oct 14, 2011 at 10:09 AM, Mike Frysinger wrote:
>> > On Friday 14 October 2011 12:47:56 Simon Glass wrote:
>> >> On Thu, Oct 13, 2011 at 6:53 PM, Mike Frysinger wrote:
>> >> > subject is "int" but implementation is "ulong"
>> >>
>> >> Yes - I wonder if I can just submit a V2 for that one patch with a new
>> >> subject?
>> >
>> > that's fine (i do it all the time). ?although in the future, your v2
>> > should probably have the reply-to field set to the v1 patch.
>>
>> OK I need to figure out how to do that with git send-email. I can see
>> how to do it with a single email, but I suppose if I post a V2 then
>> every email should be in reply to its corresponding V1, is that right?
>
> if you send out a whole new patchseries, i don't think each sub patch should
> be a reply to the original. ?having it be a new tree by itself is fine.

Oh ok.

>
>> BTW I also need some patchwork automation since a lot of the patches
>> marked 'NEW' in there are not - 'pwclient update' is most of it I
>> suppose, if it had an option to get my password back - no reply to
>> this:
>>
>> http://lists.ozlabs.org/pipermail/patchwork/2010-December/000347.html
>
> i've only used the web interface so far. ?and this extension makes life a lot
> easier when you have to select a lot (but not all) of the patches in a query:
> https://chrome.google.com/webstore/detail/ldopaogbegnhconlboidfjcmidndkbeg
> -mike
>

I can bring up a list of patches but see no checkboxes. I suppose I
need to be logged in :-(

Regards,
Simon

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

* [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number
  2011-10-14 14:31   ` Simon Glass
  2011-10-14 17:11     ` Mike Frysinger
@ 2011-10-14 19:27     ` Wolfgang Denk
  2011-10-14 21:33       ` Mike Frysinger
  1 sibling, 1 reply; 54+ messages in thread
From: Wolfgang Denk @ 2011-10-14 19:27 UTC (permalink / raw)
  To: u-boot

Dear Simon Glass,

In message <CAPnjgZ1L_5wuenKG25COx+-xHr+ULU82-X1HCg_E2r9ut8dGPw@mail.gmail.com> you wrote:
> 
> > and I cannot see how getenv_int() would work before relocation.
> 
> From what I can tell the existing getenv() function deals with this
> automatically by looking at the global flags.

This is intended just for emergency cases to fix a number of places
where code is broken, and maintainers don't bother to fix their code.

It is NOT recommended to use this in general.

Please do NOT replace the use of getenv_f() with (direct or indirect)
calls to getenv().

Best regards,

Wolfgang Denk

-- 
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
There are bugs and then there are bugs.  And then there are bugs.
                                                    - Karl Lehenbauer

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

* [U-Boot] [PATCH 01/10] Add getenv_int() to read an integer from an environment variable
  2011-10-14  0:43 ` [U-Boot] [PATCH 01/10] Add getenv_int() to read an integer from an environment variable Simon Glass
  2011-10-14  1:53   ` Mike Frysinger
@ 2011-10-14 19:29   ` Wolfgang Denk
  1 sibling, 0 replies; 54+ messages in thread
From: Wolfgang Denk @ 2011-10-14 19:29 UTC (permalink / raw)
  To: u-boot

Dear Simon Glass,

In message <1318552994-6653-2-git-send-email-sjg@chromium.org> you wrote:
>
> --- a/include/common.h
> +++ b/include/common.h
...
> +/**
> + * Decode the value of an environment variable and return it.
> + *
> + * @param name		Name of environemnt variable
> + * @param base		Number base to use (normally 10, or 16 for hex)
> + * @param default_val	Default value to return if the variable is not
> + *			found
> + * @return the decoded value, or default_val if not found
> + */

Please don't add such documentation to common.h (especially not when it
breaks the coding style for multiline comments).

Best regards,

Wolfgang Denk

-- 
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
"Just Say No."   - Nancy Reagan
"No."            - Ronald Reagan

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

* [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number
  2011-10-14 17:11     ` Mike Frysinger
@ 2011-10-14 19:30       ` Wolfgang Denk
  2011-10-14 21:05         ` Simon Glass
  0 siblings, 1 reply; 54+ messages in thread
From: Wolfgang Denk @ 2011-10-14 19:30 UTC (permalink / raw)
  To: u-boot

Dear Mike Frysinger,

In message <201110141311.55171.vapier@gentoo.org> you wrote:
>
> > From what I can tell the existing getenv() function deals with this
> > automatically by looking at the global flags.
> 
> yep, and that should be sufficient.  in the pre-relocation stages, you can only 
> have one active getenv() at a time, but that isn't anything new, and in this 
> particular case, it's fine.

No, it's not.  I NAK this.

Best regards,

Wolfgang Denk

-- 
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
A wise person makes his  own  decisions,  a  weak  one  obeys  public
opinion.                                           -- Chinese proverb

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

* [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number
  2011-10-14 19:30       ` Wolfgang Denk
@ 2011-10-14 21:05         ` Simon Glass
  0 siblings, 0 replies; 54+ messages in thread
From: Simon Glass @ 2011-10-14 21:05 UTC (permalink / raw)
  To: u-boot

Hi Wolfgang, Mike,

On Fri, Oct 14, 2011 at 12:30 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Mike Frysinger,
>
> In message <201110141311.55171.vapier@gentoo.org> you wrote:
>>
>> > From what I can tell the existing getenv() function deals with this
>> > automatically by looking at the global flags.
>>
>> yep, and that should be sufficient. ?in the pre-relocation stages, you can only
>> have one active getenv() at a time, but that isn't anything new, and in this
>> particular case, it's fine.
>
> No, it's not. ?I NAK this.

OK I am sending a v3 patch that checks for this and does the right
thing. Maybe that will help.

Regards,
Simon


>
> Best regards,
>
> Wolfgang Denk
>
> --
> 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
> A wise person makes his ?own ?decisions, ?a ?weak ?one ?obeys ?public
> opinion. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? -- Chinese proverb
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

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

* [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number
  2011-10-14 19:27     ` Wolfgang Denk
@ 2011-10-14 21:33       ` Mike Frysinger
  2011-10-14 23:28         ` Simon Glass
  0 siblings, 1 reply; 54+ messages in thread
From: Mike Frysinger @ 2011-10-14 21:33 UTC (permalink / raw)
  To: u-boot

On Friday 14 October 2011 15:27:59 Wolfgang Denk wrote:
> Simon Glass wrote:
> > > and I cannot see how getenv_int() would work before relocation.
> > 
> > From what I can tell the existing getenv() function deals with this
> > automatically by looking at the global flags.
> 
> This is intended just for emergency cases to fix a number of places
> where code is broken, and maintainers don't bother to fix their code.
> 
> It is NOT recommended to use this in general.
> 
> Please do NOT replace the use of getenv_f() with (direct or indirect)
> calls to getenv().

should we have getenv_ulong() and getenv_ulong_r() then ?
-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/20111014/6a238260/attachment.pgp 

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

* [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number
  2011-10-14 21:33       ` Mike Frysinger
@ 2011-10-14 23:28         ` Simon Glass
  0 siblings, 0 replies; 54+ messages in thread
From: Simon Glass @ 2011-10-14 23:28 UTC (permalink / raw)
  To: u-boot

Hi Mike,

On Fri, Oct 14, 2011 at 2:33 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Friday 14 October 2011 15:27:59 Wolfgang Denk wrote:
>> Simon Glass wrote:
>> > > and I cannot see how getenv_int() would work before relocation.
>> >
>> > From what I can tell the existing getenv() function deals with this
>> > automatically by looking at the global flags.
>>
>> This is intended just for emergency cases to fix a number of places
>> where code is broken, and maintainers don't bother to fix their code.
>>
>> It is NOT recommended to use this in general.
>>
>> Please do NOT replace the use of getenv_f() with (direct or indirect)
>> calls to getenv().
>
> should we have getenv_ulong() and getenv_ulong_r() then ?
> -mike
>

Since there is a flag to tell you, I don't think so - but anyway we
are back to v2, so let's see how that goes.

Regards,
Simon

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

* [U-Boot] [PATCH 02/10] arm: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 ` [U-Boot] [PATCH 02/10] arm: Use getenv_ulong() in place of getenv(), strtoul Simon Glass
@ 2011-10-23 20:50   ` Wolfgang Denk
  2011-10-23 21:49   ` Wolfgang Denk
  2011-10-23 21:51   ` [U-Boot] [PATCH] arch/arm/lib/board.c: fix build error Wolfgang Denk
  2 siblings, 0 replies; 54+ messages in thread
From: Wolfgang Denk @ 2011-10-23 20:50 UTC (permalink / raw)
  To: u-boot

Dear Simon Glass,

In message <1318552994-6653-3-git-send-email-sjg@chromium.org> you wrote:
> This changes the board code to use the new getenv_ulong() function.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>  arch/arm/lib/board.c |   36 +++++++++++-------------------------
>  1 files changed, 11 insertions(+), 25 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
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
"There's only one way to have a happy marriage and as soon as I learn
what it is I'll get married again."                  - Clint Eastwood

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

* [U-Boot] [PATCH 03/10] avr32: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 ` [U-Boot] [PATCH 03/10] avr32: Use getenv_ulong() in place of getenv(), strtoul Simon Glass
@ 2011-10-23 20:50   ` Wolfgang Denk
  0 siblings, 0 replies; 54+ messages in thread
From: Wolfgang Denk @ 2011-10-23 20:50 UTC (permalink / raw)
  To: u-boot

Dear Simon Glass,

In message <1318552994-6653-4-git-send-email-sjg@chromium.org> you wrote:
> This changes the board code to use the new getenv_ulong() function.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>  arch/avr32/lib/board.c |   16 +++-------------
>  1 files changed, 3 insertions(+), 13 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
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
"Here's a fish hangs in the net like a poor man's right in  the  law.
'Twill hardly come out."     - Shakespeare, Pericles, Act II, Scene 1

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

* [U-Boot] [PATCH 04/10] blackfin: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 ` [U-Boot] [PATCH 04/10] blackfin: " Simon Glass
  2011-10-14  1:54   ` Mike Frysinger
@ 2011-10-23 20:50   ` Wolfgang Denk
  1 sibling, 0 replies; 54+ messages in thread
From: Wolfgang Denk @ 2011-10-23 20:50 UTC (permalink / raw)
  To: u-boot

Dear Simon Glass,

In message <1318552994-6653-5-git-send-email-sjg@chromium.org> you wrote:
> This changes the board code to use the new getenv_ulong() function.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>  arch/blackfin/lib/board.c |    9 ++-------
>  1 files changed, 2 insertions(+), 7 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
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
How many seconds are there in a year? If I tell you there are 3.155 x
10^7, you won't even try to remember it. On the other hand, who could
forget that, to within half a percent, pi seconds is  a  nanocentury.
                                               -- Tom Duff, Bell Labs

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

* [U-Boot] [PATCH 05/10] m68k: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 ` [U-Boot] [PATCH 05/10] m68k: " Simon Glass
@ 2011-10-23 20:51   ` Wolfgang Denk
  0 siblings, 0 replies; 54+ messages in thread
From: Wolfgang Denk @ 2011-10-23 20:51 UTC (permalink / raw)
  To: u-boot

Dear Simon Glass,

In message <1318552994-6653-6-git-send-email-sjg@chromium.org> you wrote:
> This changes the board code to use the new getenv_ulong() function.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>  arch/m68k/lib/board.c |   33 ++++++++-------------------------
>  1 files changed, 8 insertions(+), 25 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
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
The universe does not have laws - it has habits, and  habits  can  be
broken.

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

* [U-Boot] [PATCH 06/10] microblaze: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 ` [U-Boot] [PATCH 06/10] microblaze: " Simon Glass
@ 2011-10-23 20:52   ` Wolfgang Denk
  0 siblings, 0 replies; 54+ messages in thread
From: Wolfgang Denk @ 2011-10-23 20:52 UTC (permalink / raw)
  To: u-boot

Dear Simon Glass,

In message <1318552994-6653-7-git-send-email-sjg@chromium.org> you wrote:
> This changes the board code to use the new getenv_ulong() function.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>  arch/microblaze/lib/board.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
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
This was an  amazing  creation  using  small  squares  of  compressed
vegetable  matter on which letters were made by means of small carbon
particles from a stylus, giving an effect similar to the  traditional
word-processor  screen. It seemed amazingly portable and I never once
saw him have to change the batteries.
        - Terry Pratchett & Stephen Briggs, _The Discworld Companion_

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

* [U-Boot] [PATCH 07/10] mips: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 ` [U-Boot] [PATCH 07/10] mips: " Simon Glass
@ 2011-10-23 20:52   ` Wolfgang Denk
  0 siblings, 0 replies; 54+ messages in thread
From: Wolfgang Denk @ 2011-10-23 20:52 UTC (permalink / raw)
  To: u-boot

Dear Simon Glass,

In message <1318552994-6653-8-git-send-email-sjg@chromium.org> you wrote:
> This changes the board code to use the new getenv_ulong() function.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>  arch/mips/lib/board.c |   14 +++-----------
>  1 files changed, 3 insertions(+), 11 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
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
Any sufficiently advanced bug is indistinguishable from a feature.
                                                      - Rich Kulawiec

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

* [U-Boot] [PATCH 08/10] powerpc: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 ` [U-Boot] [PATCH 08/10] powerpc: " Simon Glass
  2011-10-14  6:04   ` Stefan Roese
@ 2011-10-23 20:53   ` Wolfgang Denk
  2011-10-23 21:58   ` [U-Boot] [PATCH] arch/powerpc/lib/board.c: fix build warning Wolfgang Denk
  2 siblings, 0 replies; 54+ messages in thread
From: Wolfgang Denk @ 2011-10-23 20:53 UTC (permalink / raw)
  To: u-boot

Dear Simon Glass,

In message <1318552994-6653-9-git-send-email-sjg@chromium.org> you wrote:
> This changes the board code to use the new getenv_ulong() function.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>  arch/powerpc/lib/board.c |   33 ++++++++-------------------------
>  1 files changed, 8 insertions(+), 25 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
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
The universe is all a spin-off of the Big Bang.

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

* [U-Boot] [PATCH 09/10] sparc: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 ` [U-Boot] [PATCH 09/10] sparc: Use getenv_ulong() in place of getenv(), strtoul Simon Glass
@ 2011-10-23 20:53   ` Wolfgang Denk
  0 siblings, 0 replies; 54+ messages in thread
From: Wolfgang Denk @ 2011-10-23 20:53 UTC (permalink / raw)
  To: u-boot

Dear Simon Glass,

In message <1318552994-6653-10-git-send-email-sjg@chromium.org> you wrote:
> This changes the board code to use the new getenv_ulong() function.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>  arch/sparc/lib/board.c |   13 +++----------
>  1 files changed, 3 insertions(+), 10 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
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
You're dead, Jim.
	-- McCoy, "Amok Time", stardate 3372.7

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

* [U-Boot] [PATCH 10/10] x86: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 ` [U-Boot] [PATCH 10/10] x86: " Simon Glass
@ 2011-10-23 20:53   ` Wolfgang Denk
  0 siblings, 0 replies; 54+ messages in thread
From: Wolfgang Denk @ 2011-10-23 20:53 UTC (permalink / raw)
  To: u-boot

Dear Simon Glass,

In message <1318552994-6653-11-git-send-email-sjg@chromium.org> you wrote:
> This changes the board code to use the new getenv_ulong() function.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>  arch/x86/lib/board.c |   14 +++-----------
>  1 files changed, 3 insertions(+), 11 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
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
Successful and fortunate crime is called virtue.             - Seneca

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

* [U-Boot] [PATCH 02/10] arm: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-14  0:43 ` [U-Boot] [PATCH 02/10] arm: Use getenv_ulong() in place of getenv(), strtoul Simon Glass
  2011-10-23 20:50   ` Wolfgang Denk
@ 2011-10-23 21:49   ` Wolfgang Denk
  2011-10-24  0:19     ` Simon Glass
  2011-10-23 21:51   ` [U-Boot] [PATCH] arch/arm/lib/board.c: fix build error Wolfgang Denk
  2 siblings, 1 reply; 54+ messages in thread
From: Wolfgang Denk @ 2011-10-23 21:49 UTC (permalink / raw)
  To: u-boot

Dear Simon Glass,

In message <1318552994-6653-3-git-send-email-sjg@chromium.org> you wrote:
> This changes the board code to use the new getenv_ulong() function.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>  arch/arm/lib/board.c |   36 +++++++++++-------------------------
>  1 files changed, 11 insertions(+), 25 deletions(-)

Urgh...

This breaks almost all ARM boards like this:

Configuring for a320evb board...
board.c: In function 'board_init_r':
board.c:569: error: 's' undeclared (first use in this function)
board.c:569: error: (Each undeclared identifier is reported only once
board.c:569: error: for each function it appears in.)
make[1]: *** [/work/wd/tmp-arm/arch/arm/lib/board.o] Error 1
make: *** [/work/wd/tmp-arm/arch/arm/lib/libarm.o] Error 2


Didn't you run MAKELL?

Best regards,

Wolfgang Denk

-- 
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
ADVISORY:  There is  an  Extremely Small  but  Nonzero  Chance  That,
Through a Process Know as "Tunneling," This Product May Spontaneously
Disappear  from Its Present Location and Reappear at Any Random Place
in the Universe, Including Your Neighbor's Domicile. The Manufacturer
Will Not Be Responsible for Any Damages  or  Inconvenience  That  May
Result.

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

* [U-Boot] [PATCH] arch/arm/lib/board.c: fix build error
  2011-10-14  0:43 ` [U-Boot] [PATCH 02/10] arm: Use getenv_ulong() in place of getenv(), strtoul Simon Glass
  2011-10-23 20:50   ` Wolfgang Denk
  2011-10-23 21:49   ` Wolfgang Denk
@ 2011-10-23 21:51   ` Wolfgang Denk
  2011-10-24  0:29     ` Simon Glass
  2011-10-24  7:00     ` Heiko Schocher
  2 siblings, 2 replies; 54+ messages in thread
From: Wolfgang Denk @ 2011-10-23 21:51 UTC (permalink / raw)
  To: u-boot

Commit dc8bbea "arm: Use getenv_ulong() in place of getenv(), strtoul"
introduced a build error for all ARM boards with network support:

board.c: In function 'board_init_r':
board.c:569: error: 's' undeclared (first use in this function)
board.c:569: error: (Each undeclared identifier is reported only once
board.c:569: error: for each function it appears in.)

Fix it.

Signed-off-by: Wolfgang Denk <wd@denx.de>
---
 arch/arm/lib/board.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index c764844..367cf6b 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -441,6 +441,9 @@ void board_init_r(gd_t *id, ulong dest_addr)
 #if !defined(CONFIG_SYS_NO_FLASH)
 	ulong flash_size;
 #endif
+#if defined(CONFIG_CMD_NET)
+	char *s;
+#endif
 
 	gd = id;
 
-- 
1.7.6.2

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

* [U-Boot] [PATCH] arch/powerpc/lib/board.c: fix build warning
  2011-10-14  0:43 ` [U-Boot] [PATCH 08/10] powerpc: " Simon Glass
  2011-10-14  6:04   ` Stefan Roese
  2011-10-23 20:53   ` Wolfgang Denk
@ 2011-10-23 21:58   ` Wolfgang Denk
  2011-10-24  3:49     ` Simon Glass
  2011-11-03 19:09     ` Wolfgang Denk
  2 siblings, 2 replies; 54+ messages in thread
From: Wolfgang Denk @ 2011-10-23 21:58 UTC (permalink / raw)
  To: u-boot

Commit 1272592 "powerpc: Use getenv_ulong() in place of getenv(),
strtoul" instroduced a build warning for some PPC systems:

board.c: In function 'board_init_r':
board.c:626: warning: unused variable 's'

Fix it.

Signed-off-by: Wolfgang Denk <wd@denx.de>
---
 arch/powerpc/lib/board.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index 6cb0ed6..aff1a0c 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -623,10 +623,11 @@ void board_init_f (ulong bootflag)
  */
 void board_init_r (gd_t *id, ulong dest_addr)
 {
-	char *s;
 	bd_t *bd;
 	ulong malloc_start;
-
+#if defined(CONFIG_SYS_FLASH_CHECKSUM) || defined(CONFIG_CMD_NET)
+	char *s;
+#endif
 #ifndef CONFIG_SYS_NO_FLASH
 	ulong flash_size;
 #endif
-- 
1.7.6.2

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

* [U-Boot] [PATCH 02/10] arm: Use getenv_ulong() in place of getenv(), strtoul
  2011-10-23 21:49   ` Wolfgang Denk
@ 2011-10-24  0:19     ` Simon Glass
  0 siblings, 0 replies; 54+ messages in thread
From: Simon Glass @ 2011-10-24  0:19 UTC (permalink / raw)
  To: u-boot

Hi Wolfgang,

On Sun, Oct 23, 2011 at 2:49 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Simon Glass,
>
> In message <1318552994-6653-3-git-send-email-sjg@chromium.org> you wrote:
>> This changes the board code to use the new getenv_ulong() function.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> ---
>> ?arch/arm/lib/board.c | ? 36 +++++++++++-------------------------
>> ?1 files changed, 11 insertions(+), 25 deletions(-)
>
> Urgh...
>
> This breaks almost all ARM boards like this:
>
> Configuring for a320evb board...
> board.c: In function 'board_init_r':
> board.c:569: error: 's' undeclared (first use in this function)
> board.c:569: error: (Each undeclared identifier is reported only once
> board.c:569: error: for each function it appears in.)
> make[1]: *** [/work/wd/tmp-arm/arch/arm/lib/board.o] Error 1
> make: *** [/work/wd/tmp-arm/arch/arm/lib/libarm.o] Error 2

Sorry, I have sent a patch for this.

>
>
> Didn't you run MAKELL?

No these pre-date my getting that running (with Mike's help) and I
didn't think to go back to this series.

Regards,
Simon

>
> Best regards,
>
> Wolfgang Denk
>
> --
> 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
> ADVISORY: ?There is ?an ?Extremely Small ?but ?Nonzero ?Chance ?That,
> Through a Process Know as "Tunneling," This Product May Spontaneously
> Disappear ?from Its Present Location and Reappear at Any Random Place
> in the Universe, Including Your Neighbor's Domicile. The Manufacturer
> Will Not Be Responsible for Any Damages ?or ?Inconvenience ?That ?May
> Result.
>

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

* [U-Boot] [PATCH] arch/arm/lib/board.c: fix build error
  2011-10-23 21:51   ` [U-Boot] [PATCH] arch/arm/lib/board.c: fix build error Wolfgang Denk
@ 2011-10-24  0:29     ` Simon Glass
  2011-10-24  7:00     ` Heiko Schocher
  1 sibling, 0 replies; 54+ messages in thread
From: Simon Glass @ 2011-10-24  0:29 UTC (permalink / raw)
  To: u-boot

Hi Wolfgang,

On Sun, Oct 23, 2011 at 2:51 PM, Wolfgang Denk <wd@denx.de> wrote:
> Commit dc8bbea "arm: Use getenv_ulong() in place of getenv(), strtoul"
> introduced a build error for all ARM boards with network support:
>
> board.c: In function 'board_init_r':
> board.c:569: error: 's' undeclared (first use in this function)
> board.c:569: error: (Each undeclared identifier is reported only once
> board.c:569: error: for each function it appears in.)
>
> Fix it.

This might fix all boards if they have both net and flash, or neither.
But I sent a patch which tries to handle the case where we have one
but not the other.

(I suspect the PPC warning might be similar, but will wait until I
have done a MAKEALL before commenting on that)

Regards,
Simon

>
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> ---
> ?arch/arm/lib/board.c | ? ?3 +++
> ?1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
> index c764844..367cf6b 100644
> --- a/arch/arm/lib/board.c
> +++ b/arch/arm/lib/board.c
> @@ -441,6 +441,9 @@ void board_init_r(gd_t *id, ulong dest_addr)
> ?#if !defined(CONFIG_SYS_NO_FLASH)
> ? ? ? ?ulong flash_size;
> ?#endif
> +#if defined(CONFIG_CMD_NET)
> + ? ? ? char *s;
> +#endif
>
> ? ? ? ?gd = id;
>
> --
> 1.7.6.2
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

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

* [U-Boot] [PATCH] arch/powerpc/lib/board.c: fix build warning
  2011-10-23 21:58   ` [U-Boot] [PATCH] arch/powerpc/lib/board.c: fix build warning Wolfgang Denk
@ 2011-10-24  3:49     ` Simon Glass
  2011-10-24  6:53       ` Heiko Schocher
  2011-11-03 19:09     ` Wolfgang Denk
  1 sibling, 1 reply; 54+ messages in thread
From: Simon Glass @ 2011-10-24  3:49 UTC (permalink / raw)
  To: u-boot

Hi Wolfgang,

On Sun, Oct 23, 2011 at 2:58 PM, Wolfgang Denk <wd@denx.de> wrote:
> Commit 1272592 "powerpc: Use getenv_ulong() in place of getenv(),
> strtoul" instroduced a build warning for some PPC systems:
>
> board.c: In function 'board_init_r':
> board.c:626: warning: unused variable 's'
>
> Fix it.
>
> Signed-off-by: Wolfgang Denk <wd@denx.de>

I sent an alternative to this but they are roughly equivalent so:

Acked-by: Simon Glass <sjg@chromium.org>

Thanks for fixing this.

Regards,
Simon

> ---
> ?arch/powerpc/lib/board.c | ? ?5 +++--
> ?1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
> index 6cb0ed6..aff1a0c 100644
> --- a/arch/powerpc/lib/board.c
> +++ b/arch/powerpc/lib/board.c
> @@ -623,10 +623,11 @@ void board_init_f (ulong bootflag)
> ?*/
> ?void board_init_r (gd_t *id, ulong dest_addr)
> ?{
> - ? ? ? char *s;
> ? ? ? ?bd_t *bd;
> ? ? ? ?ulong malloc_start;
> -
> +#if defined(CONFIG_SYS_FLASH_CHECKSUM) || defined(CONFIG_CMD_NET)
> + ? ? ? char *s;
> +#endif
> ?#ifndef CONFIG_SYS_NO_FLASH
> ? ? ? ?ulong flash_size;
> ?#endif
> --
> 1.7.6.2
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

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

* [U-Boot] [PATCH] arch/powerpc/lib/board.c: fix build warning
  2011-10-24  3:49     ` Simon Glass
@ 2011-10-24  6:53       ` Heiko Schocher
  0 siblings, 0 replies; 54+ messages in thread
From: Heiko Schocher @ 2011-10-24  6:53 UTC (permalink / raw)
  To: u-boot

Hello Simon, Wolfgang,

Simon Glass wrote:
> Hi Wolfgang,
> 
> On Sun, Oct 23, 2011 at 2:58 PM, Wolfgang Denk <wd@denx.de> wrote:
>> Commit 1272592 "powerpc: Use getenv_ulong() in place of getenv(),
>> strtoul" instroduced a build warning for some PPC systems:
>>
>> board.c: In function 'board_init_r':
>> board.c:626: warning: unused variable 's'
>>
>> Fix it.
>>
>> Signed-off-by: Wolfgang Denk <wd@denx.de>
> 
> I sent an alternative to this but they are roughly equivalent so:
> 
> Acked-by: Simon Glass <sjg@chromium.org>

Same on arm, posted for this a patch.

Acked-by: Heiko Schocher <hs@denx.de>

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

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

* [U-Boot] [PATCH] arch/arm/lib/board.c: fix build error
  2011-10-23 21:51   ` [U-Boot] [PATCH] arch/arm/lib/board.c: fix build error Wolfgang Denk
  2011-10-24  0:29     ` Simon Glass
@ 2011-10-24  7:00     ` Heiko Schocher
  1 sibling, 0 replies; 54+ messages in thread
From: Heiko Schocher @ 2011-10-24  7:00 UTC (permalink / raw)
  To: u-boot

Hello Wolfgang,

Wolfgang Denk wrote:
> Commit dc8bbea "arm: Use getenv_ulong() in place of getenv(), strtoul"
> introduced a build error for all ARM boards with network support:
> 
> board.c: In function 'board_init_r':
> board.c:569: error: 's' undeclared (first use in this function)
> board.c:569: error: (Each undeclared identifier is reported only once
> board.c:569: error: for each function it appears in.)
> 
> Fix it.
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>

posted a patch too, see your fix too late, sorry, so
forget my patch:

Acked-by: Heiko Schocher <hs@denx.de>

for this.

Thanks for fixing.

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

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

* [U-Boot] [PATCH] arch/powerpc/lib/board.c: fix build warning
  2011-10-23 21:58   ` [U-Boot] [PATCH] arch/powerpc/lib/board.c: fix build warning Wolfgang Denk
  2011-10-24  3:49     ` Simon Glass
@ 2011-11-03 19:09     ` Wolfgang Denk
  2011-11-04  6:44       ` Kumar Gala
  1 sibling, 1 reply; 54+ messages in thread
From: Wolfgang Denk @ 2011-11-03 19:09 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang Denk,

In message <1319407132-6590-1-git-send-email-wd@denx.de> you wrote:
> Commit 1272592 "powerpc: Use getenv_ulong() in place of getenv(),
> strtoul" instroduced a build warning for some PPC systems:
> 
> board.c: In function 'board_init_r':
> board.c:626: warning: unused variable 's'
> 
> Fix it.
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> ---
>  arch/powerpc/lib/board.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
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
Overflow on /dev/null, please empty the bit bucket.

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

* [U-Boot] [PATCH] arch/powerpc/lib/board.c: fix build warning
  2011-11-03 19:09     ` Wolfgang Denk
@ 2011-11-04  6:44       ` Kumar Gala
  2011-11-04  6:47         ` Kumar Gala
  0 siblings, 1 reply; 54+ messages in thread
From: Kumar Gala @ 2011-11-04  6:44 UTC (permalink / raw)
  To: u-boot


On Nov 3, 2011, at 2:09 PM, Wolfgang Denk wrote:

> Dear Wolfgang Denk,
> 
> In message <1319407132-6590-1-git-send-email-wd@denx.de> you wrote:
>> Commit 1272592 "powerpc: Use getenv_ulong() in place of getenv(),
>> strtoul" instroduced a build warning for some PPC systems:
>> 
>> board.c: In function 'board_init_r':
>> board.c:626: warning: unused variable 's'
>> 
>> Fix it.
>> 
>> Signed-off-by: Wolfgang Denk <wd@denx.de>
>> ---
>> arch/powerpc/lib/board.c |    5 +++--
>> 1 files changed, 3 insertions(+), 2 deletions(-)
> 
> Applied, thanks.
> 
> Best regards,
> 
> Wolfgang Denk

I'm still seeing this warning when building MPC8536DS_config

- k

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

* [U-Boot] [PATCH] arch/powerpc/lib/board.c: fix build warning
  2011-11-04  6:44       ` Kumar Gala
@ 2011-11-04  6:47         ` Kumar Gala
  2011-11-04 15:41           ` Kim Phillips
  2011-11-04 21:13           ` Mike Frysinger
  0 siblings, 2 replies; 54+ messages in thread
From: Kumar Gala @ 2011-11-04  6:47 UTC (permalink / raw)
  To: u-boot


On Nov 4, 2011, at 1:44 AM, Kumar Gala wrote:

> 
> On Nov 3, 2011, at 2:09 PM, Wolfgang Denk wrote:
> 
>> Dear Wolfgang Denk,
>> 
>> In message <1319407132-6590-1-git-send-email-wd@denx.de> you wrote:
>>> Commit 1272592 "powerpc: Use getenv_ulong() in place of getenv(),
>>> strtoul" instroduced a build warning for some PPC systems:
>>> 
>>> board.c: In function 'board_init_r':
>>> board.c:626: warning: unused variable 's'
>>> 
>>> Fix it.
>>> 
>>> Signed-off-by: Wolfgang Denk <wd@denx.de>
>>> ---
>>> arch/powerpc/lib/board.c |    5 +++--
>>> 1 files changed, 3 insertions(+), 2 deletions(-)
>> 
>> Applied, thanks.
>> 
>> Best regards,
>> 
>> Wolfgang Denk
> 
> I'm still seeing this warning when building MPC8536DS_config
> 
> - k
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

I think we need to revert this now.

I don't see why you'd need it.

- k

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

* [U-Boot] [PATCH] arch/powerpc/lib/board.c: fix build warning
  2011-11-04  6:47         ` Kumar Gala
@ 2011-11-04 15:41           ` Kim Phillips
  2011-11-04 21:13           ` Mike Frysinger
  1 sibling, 0 replies; 54+ messages in thread
From: Kim Phillips @ 2011-11-04 15:41 UTC (permalink / raw)
  To: u-boot

On Fri, 4 Nov 2011 01:47:04 -0500
Kumar Gala <galak@kernel.crashing.org> wrote:

> On Nov 4, 2011, at 1:44 AM, Kumar Gala wrote:
> > On Nov 3, 2011, at 2:09 PM, Wolfgang Denk wrote:
> >> In message <1319407132-6590-1-git-send-email-wd@denx.de> you wrote:
> >>> Commit 1272592 "powerpc: Use getenv_ulong() in place of getenv(),
> >>> strtoul" instroduced a build warning for some PPC systems:
> >>> 
> >>> board.c: In function 'board_init_r':
> >>> board.c:626: warning: unused variable 's'
> >>> 
> >>> Fix it.
> >>> 
> >>> Signed-off-by: Wolfgang Denk <wd@denx.de>
> >>> ---
> >>> arch/powerpc/lib/board.c |    5 +++--
> >>> 1 files changed, 3 insertions(+), 2 deletions(-)
> >> 
> >> Applied, thanks.
> > 
> > I'm still seeing this warning when building MPC8536DS_config

me too, on most 83xx boards.

> I think we need to revert this now.
> 
> I don't see why you'd need it.

yes, all code fragments that utilize a variable 's' declare one local
to their code body.

Kim

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

* [U-Boot] [PATCH] arch/powerpc/lib/board.c: fix build warning
  2011-11-04  6:47         ` Kumar Gala
  2011-11-04 15:41           ` Kim Phillips
@ 2011-11-04 21:13           ` Mike Frysinger
  2011-11-04 21:34             ` [U-Boot] [PATCH] powerpc: Revert "arch/powerpc/lib/board.c: fix build warning" Kim Phillips
  1 sibling, 1 reply; 54+ messages in thread
From: Mike Frysinger @ 2011-11-04 21:13 UTC (permalink / raw)
  To: u-boot

On Friday 04 November 2011 02:47:04 Kumar Gala wrote:
> On Nov 4, 2011, at 1:44 AM, Kumar Gala wrote:
> > On Nov 3, 2011, at 2:09 PM, Wolfgang Denk wrote:
> >> Wolfgang Denk wrote:
> >>> Commit 1272592 "powerpc: Use getenv_ulong() in place of getenv(),
> >>> strtoul" instroduced a build warning for some PPC systems:
> >>> 
> >>> board.c: In function 'board_init_r':
> >>> board.c:626: warning: unused variable 's'
> >>> 
> >>> Fix it.
> >>> 
> >>> Signed-off-by: Wolfgang Denk <wd@denx.de>
> >>> ---
> >>> arch/powerpc/lib/board.c |    5 +++--
> >>> 1 files changed, 3 insertions(+), 2 deletions(-)
> >> 
> >> Applied, thanks.
> >> 
> >> Best regards,
> >> 
> >> Wolfgang Denk
> > 
> > I'm still seeing this warning when building MPC8536DS_config
> 
> I think we need to revert this now.

so post a revert of a9f4fc3fe571cc99260b063ad0ff291d31bafed0

> I don't see why you'd need it.

Wolfgang's patch was written before Simon's, but they both ended up getting 
merged when we only needed one of them ...
-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/20111104/867a2860/attachment.pgp 

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

* [U-Boot] [PATCH] powerpc: Revert "arch/powerpc/lib/board.c: fix build warning"
  2011-11-04 21:13           ` Mike Frysinger
@ 2011-11-04 21:34             ` Kim Phillips
  2011-11-05  9:33               ` Wolfgang Denk
  0 siblings, 1 reply; 54+ messages in thread
From: Kim Phillips @ 2011-11-04 21:34 UTC (permalink / raw)
  To: u-boot

This reverts commit a9f4fc3fe571cc99260b063ad0ff291d31bafed0.

commit aab773a47a8f7f40b9d7c4877853b00d22fb1347 already fixed the
issue.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
---
 arch/powerpc/lib/board.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index 3a1b375..508075f 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -625,9 +625,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
 {
 	bd_t *bd;
 	ulong malloc_start;
-#if defined(CONFIG_SYS_FLASH_CHECKSUM) || defined(CONFIG_CMD_NET)
-	char *s;
-#endif
+
 #ifndef CONFIG_SYS_NO_FLASH
 	ulong flash_size;
 #endif
-- 
1.7.7.2

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

* [U-Boot] [PATCH] powerpc: Revert "arch/powerpc/lib/board.c: fix build warning"
  2011-11-04 21:34             ` [U-Boot] [PATCH] powerpc: Revert "arch/powerpc/lib/board.c: fix build warning" Kim Phillips
@ 2011-11-05  9:33               ` Wolfgang Denk
  2011-11-06 18:06                 ` Mike Frysinger
  0 siblings, 1 reply; 54+ messages in thread
From: Wolfgang Denk @ 2011-11-05  9:33 UTC (permalink / raw)
  To: u-boot

Dear Kim Phillips,

In message <20111104163427.db13a668c89386e254098062@freescale.com> you wrote:
> This reverts commit a9f4fc3fe571cc99260b063ad0ff291d31bafed0.
> 
> commit aab773a47a8f7f40b9d7c4877853b00d22fb1347 already fixed the
> issue.
> 
> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
> ---
>  arch/powerpc/lib/board.c |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
> index 3a1b375..508075f 100644
> --- a/arch/powerpc/lib/board.c
> +++ b/arch/powerpc/lib/board.c
> @@ -625,9 +625,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
>  {
>  	bd_t *bd;
>  	ulong malloc_start;
> -#if defined(CONFIG_SYS_FLASH_CHECKSUM) || defined(CONFIG_CMD_NET)
> -	char *s;
> -#endif
> +

Which tree / version is your patch based on?  It does not apply to
master.  We fixed this with commit commit ecfd752.

Best regards,

Wolfgang Denk

-- 
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
The most difficult thing in the world is to know how to  do  a  thing
and to watch someone else doing it wrong, without commenting.
                                                        -- T.H. White

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

* [U-Boot] [PATCH] powerpc: Revert "arch/powerpc/lib/board.c: fix build warning"
  2011-11-05  9:33               ` Wolfgang Denk
@ 2011-11-06 18:06                 ` Mike Frysinger
  2011-11-06 19:49                   ` Wolfgang Denk
  0 siblings, 1 reply; 54+ messages in thread
From: Mike Frysinger @ 2011-11-06 18:06 UTC (permalink / raw)
  To: u-boot

On Saturday 05 November 2011 05:33:38 Wolfgang Denk wrote:
> Kim Phillips wrote:
> > This reverts commit a9f4fc3fe571cc99260b063ad0ff291d31bafed0.
> > 
> > commit aab773a47a8f7f40b9d7c4877853b00d22fb1347 already fixed the
> > issue.
> > 
> > --- a/arch/powerpc/lib/board.c
> > +++ b/arch/powerpc/lib/board.c
> > @@ -625,9 +625,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
> > 
> >  {
> >  
> >  	bd_t *bd;
> >  	ulong malloc_start;
> > 
> > -#if defined(CONFIG_SYS_FLASH_CHECKSUM) || defined(CONFIG_CMD_NET)
> > -	char *s;
> > -#endif
> > +
> 
> Which tree / version is your patch based on?  It does not apply to
> master.  We fixed this with commit commit ecfd752.

have you pushed out your master in a while ?  i see your tree sitting at 
fec79acc864bed049b6beae719ccbf2bbec5403a which still has this warning.  i also 
don't see commit ecfd752 in your tree.
-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/20111106/2b03b6fa/attachment.pgp 

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

* [U-Boot] [PATCH] powerpc: Revert "arch/powerpc/lib/board.c: fix build warning"
  2011-11-06 18:06                 ` Mike Frysinger
@ 2011-11-06 19:49                   ` Wolfgang Denk
  0 siblings, 0 replies; 54+ messages in thread
From: Wolfgang Denk @ 2011-11-06 19:49 UTC (permalink / raw)
  To: u-boot

Dear Mike Frysinger,

In message <201111061306.37421.vapier@gentoo.org> you wrote:
>
> have you pushed out your master in a while ?  i see your tree sitting at 
> fec79acc864bed049b6beae719ccbf2bbec5403a which still has this warning.  i also 
> don't see commit ecfd752 in your tree.

master is in sync.  But you are right - ecfd752 is in my GCC 4.6
cleanup branch.

I will wait another day for feedback on these and then pull them.

Best regards,

Wolfgang Denk

-- 
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
Is truth not truth for all?
	-- Natira, "For the World is Hollow and I have Touched
		   the Sky", stardate 5476.4.

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

end of thread, other threads:[~2011-11-06 19:49 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-14  0:43 [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number Simon Glass
2011-10-14  0:43 ` [U-Boot] [PATCH 01/10] Add getenv_int() to read an integer from an environment variable Simon Glass
2011-10-14  1:53   ` Mike Frysinger
2011-10-14 16:47     ` Simon Glass
2011-10-14 17:09       ` Mike Frysinger
2011-10-14 17:42         ` Simon Glass
2011-10-14 18:06           ` Mike Frysinger
2011-10-14 18:15             ` Simon Glass
2011-10-14 19:29   ` Wolfgang Denk
2011-10-14  0:43 ` [U-Boot] [PATCH 02/10] arm: Use getenv_ulong() in place of getenv(), strtoul Simon Glass
2011-10-23 20:50   ` Wolfgang Denk
2011-10-23 21:49   ` Wolfgang Denk
2011-10-24  0:19     ` Simon Glass
2011-10-23 21:51   ` [U-Boot] [PATCH] arch/arm/lib/board.c: fix build error Wolfgang Denk
2011-10-24  0:29     ` Simon Glass
2011-10-24  7:00     ` Heiko Schocher
2011-10-14  0:43 ` [U-Boot] [PATCH 03/10] avr32: Use getenv_ulong() in place of getenv(), strtoul Simon Glass
2011-10-23 20:50   ` Wolfgang Denk
2011-10-14  0:43 ` [U-Boot] [PATCH 04/10] blackfin: " Simon Glass
2011-10-14  1:54   ` Mike Frysinger
2011-10-23 20:50   ` Wolfgang Denk
2011-10-14  0:43 ` [U-Boot] [PATCH 05/10] m68k: " Simon Glass
2011-10-23 20:51   ` Wolfgang Denk
2011-10-14  0:43 ` [U-Boot] [PATCH 06/10] microblaze: " Simon Glass
2011-10-23 20:52   ` Wolfgang Denk
2011-10-14  0:43 ` [U-Boot] [PATCH 07/10] mips: " Simon Glass
2011-10-23 20:52   ` Wolfgang Denk
2011-10-14  0:43 ` [U-Boot] [PATCH 08/10] powerpc: " Simon Glass
2011-10-14  6:04   ` Stefan Roese
2011-10-23 20:53   ` Wolfgang Denk
2011-10-23 21:58   ` [U-Boot] [PATCH] arch/powerpc/lib/board.c: fix build warning Wolfgang Denk
2011-10-24  3:49     ` Simon Glass
2011-10-24  6:53       ` Heiko Schocher
2011-11-03 19:09     ` Wolfgang Denk
2011-11-04  6:44       ` Kumar Gala
2011-11-04  6:47         ` Kumar Gala
2011-11-04 15:41           ` Kim Phillips
2011-11-04 21:13           ` Mike Frysinger
2011-11-04 21:34             ` [U-Boot] [PATCH] powerpc: Revert "arch/powerpc/lib/board.c: fix build warning" Kim Phillips
2011-11-05  9:33               ` Wolfgang Denk
2011-11-06 18:06                 ` Mike Frysinger
2011-11-06 19:49                   ` Wolfgang Denk
2011-10-14  0:43 ` [U-Boot] [PATCH 09/10] sparc: Use getenv_ulong() in place of getenv(), strtoul Simon Glass
2011-10-23 20:53   ` Wolfgang Denk
2011-10-14  0:43 ` [U-Boot] [PATCH 10/10] x86: " Simon Glass
2011-10-23 20:53   ` Wolfgang Denk
2011-10-14  6:13 ` [U-Boot] [PATCH 0/10] Add getenv_ulong to return an environment var as a number Reinhard Meyer
2011-10-14 14:31   ` Simon Glass
2011-10-14 17:11     ` Mike Frysinger
2011-10-14 19:30       ` Wolfgang Denk
2011-10-14 21:05         ` Simon Glass
2011-10-14 19:27     ` Wolfgang Denk
2011-10-14 21:33       ` Mike Frysinger
2011-10-14 23:28         ` Simon Glass

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