All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] netloop: updates for NetLoop
@ 2009-02-25 12:40 Heiko Schocher
  2009-02-25 17:01 ` Mike Frysinger
  0 siblings, 1 reply; 16+ messages in thread
From: Heiko Schocher @ 2009-02-25 12:40 UTC (permalink / raw)
  To: u-boot

Fix some issues introduced from commit:
2f70c49e5b9813635ad73666aa30f304c7fdeda9
suggested by Mike Frysinger.

- added some comment for the env_id variable in
  common/cmd_nvedit.c
- moved some variables in fn scope instead of
  file scope
- NetInitLoop now static void

Signed-off-by: Heiko Schocher <hs@denx.de>
---
 common/cmd_nvedit.c |    6 ++++++
 net/eth.c           |    5 ++---
 net/net.c           |    9 ++++-----
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 95eebb5..3caa841 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -75,6 +75,12 @@ DECLARE_GLOBAL_DATA_PTR;
 static const unsigned long baudrate_table[] = CONFIG_SYS_BAUDRATE_TABLE;
 #define	N_BAUDRATES (sizeof(baudrate_table) / sizeof(baudrate_table[0]))

+/*
+ * This variable is incremented on each do_setenv (), so it can
+ * be used as an indication, if the environment has changed or not.
+ * So it is possible to reread an environment variable only if the
+ * environment was changed ... done so for example in NetInitLoop()
+ */
 static int env_id = 1;

 int get_env_id (void)
diff --git a/net/eth.c b/net/eth.c
index 4bbf84b..a494912 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -57,9 +57,6 @@ int eth_setenv_enetaddr(char *name, const uchar *enetaddr)

 #if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI)

-static char *act = NULL;
-static int  env_changed_id = 0;
-
 /*
  * CPU and board-specific Ethernet initializations.  Aliased function
  * signals caller to move on
@@ -471,6 +468,8 @@ void eth_try_another(int first_restart)
 #ifdef CONFIG_NET_MULTI
 void eth_set_current(void)
 {
+	static char *act = NULL;
+	static int  env_changed_id = 0;
 	struct eth_device* old_current;
 	int	env_id;

diff --git a/net/net.c b/net/net.c
index a89f6a0..a80c814 100644
--- a/net/net.c
+++ b/net/net.c
@@ -209,8 +209,6 @@ uchar		NetArpWaitPacketBuf[PKTSIZE_ALIGN + PKTALIGN];
 ulong		NetArpWaitTimerStart;
 int		NetArpWaitTry;

-int		env_changed_id = 0;
-
 void ArpRequest (void)
 {
 	int i;
@@ -278,15 +276,16 @@ void ArpTimeoutCheck(void)
 	}
 }

-int
+static void
 NetInitLoop(proto_t protocol)
 {
+	static int	env_changed_id = 0;
 	bd_t *bd = gd->bd;
 	int env_id = get_env_id ();

 	/* update only when the environment has changed */
 	if (env_changed_id == env_id)
-		return 0;
+		return;

 	switch (protocol) {
 #if defined(CONFIG_CMD_NFS)
@@ -347,7 +346,7 @@ NetInitLoop(proto_t protocol)
 		break;
 	}
 	env_changed_id = env_id;
-	return 0;
+	return;
 }

 /**********************************************************************/
-- 
1.6.0.6

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

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

* [U-Boot] [PATCH] netloop: updates for NetLoop
  2009-02-25 12:40 [U-Boot] [PATCH] netloop: updates for NetLoop Heiko Schocher
@ 2009-02-25 17:01 ` Mike Frysinger
  2009-02-26  7:16   ` [U-Boot] [PATCH v2] " Heiko Schocher
  0 siblings, 1 reply; 16+ messages in thread
From: Mike Frysinger @ 2009-02-25 17:01 UTC (permalink / raw)
  To: u-boot

On Wednesday 25 February 2009 07:40:45 Heiko Schocher wrote:
> +/*
> + * This variable is incremented on each do_setenv (), so it can
> + * be used as an indication, if the environment has changed or not.
> + * So it is possible to reread an environment variable only if the
> + * environment was changed ... done so for example in NetInitLoop()
> + */

i would tweak it to say "... it can be used via get_env_id() as an ..."

> -	return 0;
> +	return;
>  }

a return at the end of a function is pointless imo.  just delete it.
-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/20090225/0c8747d6/attachment.pgp 

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

* [U-Boot] [PATCH v2] netloop: updates for NetLoop
  2009-02-25 17:01 ` Mike Frysinger
@ 2009-02-26  7:16   ` Heiko Schocher
  2009-02-26  8:47     ` Mike Frysinger
                       ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Heiko Schocher @ 2009-02-26  7:16 UTC (permalink / raw)
  To: u-boot

[PATCH v2] netloop: updates for NetLoop

Fix some issues introduced from commit:
2f70c49e5b9813635ad73666aa30f304c7fdeda9
suggested by Mike Frysinger.

- added some comment for the env_id variable in common_cmd_nvedit.c
- moved some variables in fn scope instead of file scope
- NetInitLoop now static void

Signed-off-by: Heiko Schocher <hs@denx.de>
---
changes since v1:
- added comments from Mike Frysinger

 common/cmd_nvedit.c |    7 +++++++
 net/eth.c           |    5 ++---
 net/net.c           |    8 +++-----
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 95eebb5..30e296c 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -75,6 +75,13 @@ DECLARE_GLOBAL_DATA_PTR;
 static const unsigned long baudrate_table[] = CONFIG_SYS_BAUDRATE_TABLE;
 #define	N_BAUDRATES (sizeof(baudrate_table) / sizeof(baudrate_table[0]))

+/*
+ * This variable is incremented on each do_setenv (), so it can
+ * be used via get_env_id() as an indication, if the environment
+ * has changed or not. So it is possible to reread an environment
+ * variable only if the environment was changed ... done so for
+ * example in NetInitLoop()
+ */
 static int env_id = 1;

 int get_env_id (void)
diff --git a/net/eth.c b/net/eth.c
index 4bbf84b..a494912 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -57,9 +57,6 @@ int eth_setenv_enetaddr(char *name, const uchar *enetaddr)

 #if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI)

-static char *act = NULL;
-static int  env_changed_id = 0;
-
 /*
  * CPU and board-specific Ethernet initializations.  Aliased function
  * signals caller to move on
@@ -471,6 +468,8 @@ void eth_try_another(int first_restart)
 #ifdef CONFIG_NET_MULTI
 void eth_set_current(void)
 {
+	static char *act = NULL;
+	static int  env_changed_id = 0;
 	struct eth_device* old_current;
 	int	env_id;

diff --git a/net/net.c b/net/net.c
index a89f6a0..0887f6e 100644
--- a/net/net.c
+++ b/net/net.c
@@ -209,8 +209,6 @@ uchar		NetArpWaitPacketBuf[PKTSIZE_ALIGN + PKTALIGN];
 ulong		NetArpWaitTimerStart;
 int		NetArpWaitTry;

-int		env_changed_id = 0;
-
 void ArpRequest (void)
 {
 	int i;
@@ -278,15 +276,16 @@ void ArpTimeoutCheck(void)
 	}
 }

-int
+static void
 NetInitLoop(proto_t protocol)
 {
+	static int	env_changed_id = 0;
 	bd_t *bd = gd->bd;
 	int env_id = get_env_id ();

 	/* update only when the environment has changed */
 	if (env_changed_id == env_id)
-		return 0;
+		return;

 	switch (protocol) {
 #if defined(CONFIG_CMD_NFS)
@@ -347,7 +346,6 @@ NetInitLoop(proto_t protocol)
 		break;
 	}
 	env_changed_id = env_id;
-	return 0;
 }

 /**********************************************************************/
-- 
1.6.0.6

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

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

* [U-Boot] [PATCH v2] netloop: updates for NetLoop
  2009-02-26  7:16   ` [U-Boot] [PATCH v2] " Heiko Schocher
@ 2009-02-26  8:47     ` Mike Frysinger
  2009-04-03 21:57     ` Wolfgang Denk
  2009-04-27 22:09     ` Wolfgang Denk
  2 siblings, 0 replies; 16+ messages in thread
From: Mike Frysinger @ 2009-02-26  8:47 UTC (permalink / raw)
  To: u-boot

On Thursday 26 February 2009 02:16:52 Heiko Schocher wrote:
> [PATCH v2] netloop: updates for NetLoop
>
> Fix some issues introduced from commit:
> 2f70c49e5b9813635ad73666aa30f304c7fdeda9
> suggested by Mike Frysinger.
>
> - added some comment for the env_id variable in common_cmd_nvedit.c
> - moved some variables in fn scope instead of file scope
> - NetInitLoop now static void
>
> Signed-off-by: Heiko Schocher <hs@denx.de>

Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike

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

* [U-Boot] [PATCH v2] netloop: updates for NetLoop
  2009-02-26  7:16   ` [U-Boot] [PATCH v2] " Heiko Schocher
  2009-02-26  8:47     ` Mike Frysinger
@ 2009-04-03 21:57     ` Wolfgang Denk
  2009-04-03 23:28       ` Michael Zaidman
  2009-04-24 19:45       ` Wolfgang Denk
  2009-04-27 22:09     ` Wolfgang Denk
  2 siblings, 2 replies; 16+ messages in thread
From: Wolfgang Denk @ 2009-04-03 21:57 UTC (permalink / raw)
  To: u-boot

Dear Ben,

In message <49A641E4.8000001@denx.de> you wrote:
> [PATCH v2] netloop: updates for NetLoop
> 
> Fix some issues introduced from commit:
> 2f70c49e5b9813635ad73666aa30f304c7fdeda9
> suggested by Mike Frysinger.
> 
> - added some comment for the env_id variable in common_cmd_nvedit.c
> - moved some variables in fn scope instead of file scope
> - NetInitLoop now static void
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>
> ---
> changes since v1:
> - added comments from Mike Frysinger
> 
>  common/cmd_nvedit.c |    7 +++++++
>  net/eth.c           |    5 ++---
>  net/net.c           |    8 +++-----
>  3 files changed, 12 insertions(+), 8 deletions(-)

Except for an Ack from Mike I did not see any comments?

Ditto for this one:

http://article.gmane.org/gmane.comp.boot-loaders.u-boot/55341

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
Children are natural mimics who act like their parents despite  every
effort to teach them good manners.

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

* [U-Boot] [PATCH v2] netloop: updates for NetLoop
  2009-04-03 21:57     ` Wolfgang Denk
@ 2009-04-03 23:28       ` Michael Zaidman
  2009-04-24 19:45       ` Wolfgang Denk
  1 sibling, 0 replies; 16+ messages in thread
From: Michael Zaidman @ 2009-04-03 23:28 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang & Ben,

>
> Ditto for this one:
>
> http://article.gmane.org/gmane.comp.boot-loaders.u-boot/55341

The patch content is obsolete due to the "NetLoop initialization bug" fix.

Regards,
Michael

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

* [U-Boot] [PATCH v2] netloop: updates for NetLoop
  2009-04-03 21:57     ` Wolfgang Denk
  2009-04-03 23:28       ` Michael Zaidman
@ 2009-04-24 19:45       ` Wolfgang Denk
  2009-04-24 23:41         ` Ben Warren
  1 sibling, 1 reply; 16+ messages in thread
From: Wolfgang Denk @ 2009-04-24 19:45 UTC (permalink / raw)
  To: u-boot

Dear Ben,

In message <20090403215728.930BE83797DC@gemini.denx.de> I wrote:
> Dear Ben,
> 
> In message <49A641E4.8000001@denx.de> you wrote:
> > [PATCH v2] netloop: updates for NetLoop
> > 
> > Fix some issues introduced from commit:
> > 2f70c49e5b9813635ad73666aa30f304c7fdeda9
> > suggested by Mike Frysinger.
> > 
> > - added some comment for the env_id variable in common_cmd_nvedit.c
> > - moved some variables in fn scope instead of file scope
> > - NetInitLoop now static void
> > 
> > Signed-off-by: Heiko Schocher <hs@denx.de>
> > ---
> > changes since v1:
> > - added comments from Mike Frysinger
> > 
> >  common/cmd_nvedit.c |    7 +++++++
> >  net/eth.c           |    5 ++---
> >  net/net.c           |    8 +++-----
> >  3 files changed, 12 insertions(+), 8 deletions(-)
> 
> Except for an Ack from Mike I did not see any comments?
> 
> Ditto for this one:
> 
> http://article.gmane.org/gmane.comp.boot-loaders.u-boot/55341

Please comment -- if you want, I can apply directly.

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
I mean, I . . . think to understand you, I just don't know  what  you
are saying ...                        - Terry Pratchett, _Soul Music_

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

* [U-Boot] [PATCH v2] netloop: updates for NetLoop
  2009-04-24 19:45       ` Wolfgang Denk
@ 2009-04-24 23:41         ` Ben Warren
  0 siblings, 0 replies; 16+ messages in thread
From: Ben Warren @ 2009-04-24 23:41 UTC (permalink / raw)
  To: u-boot

Hi Wolfgang,

Wolfgang Denk wrote:
> Dear Ben,
>
> In message <20090403215728.930BE83797DC@gemini.denx.de> I wrote:
>   
>> Dear Ben,
>>
>> In message <49A641E4.8000001@denx.de> you wrote:
>>     
>>> [PATCH v2] netloop: updates for NetLoop
>>>
>>> Fix some issues introduced from commit:
>>> 2f70c49e5b9813635ad73666aa30f304c7fdeda9
>>> suggested by Mike Frysinger.
>>>
>>> - added some comment for the env_id variable in common_cmd_nvedit.c
>>> - moved some variables in fn scope instead of file scope
>>> - NetInitLoop now static void
>>>
>>> Signed-off-by: Heiko Schocher <hs@denx.de>
>>> ---
>>> changes since v1:
>>> - added comments from Mike Frysinger
>>>
>>>  common/cmd_nvedit.c |    7 +++++++
>>>  net/eth.c           |    5 ++---
>>>  net/net.c           |    8 +++-----
>>>  3 files changed, 12 insertions(+), 8 deletions(-)
>>>       
>> Except for an Ack from Mike I did not see any comments?
>>
>> Ditto for this one:
>>
>> http://article.gmane.org/gmane.comp.boot-loaders.u-boot/55341
>>     
>
> Please comment -- if you want, I can apply directly.
>
> Best regards,
>
> Wolfgang Denk
>   
Sorry, thought I was caught up.  This looks good - please apply directly.

thanks,
Ben

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

* [U-Boot] [PATCH v2] netloop: updates for NetLoop
  2009-02-26  7:16   ` [U-Boot] [PATCH v2] " Heiko Schocher
  2009-02-26  8:47     ` Mike Frysinger
  2009-04-03 21:57     ` Wolfgang Denk
@ 2009-04-27 22:09     ` Wolfgang Denk
  2009-04-28  5:41       ` [U-Boot] [PATCH] [PATCH v3] " Heiko Schocher
  2 siblings, 1 reply; 16+ messages in thread
From: Wolfgang Denk @ 2009-04-27 22:09 UTC (permalink / raw)
  To: u-boot

Dear Heiko Schocher,

In message <49A641E4.8000001@denx.de> you wrote:
> [PATCH v2] netloop: updates for NetLoop
> 
> Fix some issues introduced from commit:
> 2f70c49e5b9813635ad73666aa30f304c7fdeda9
> suggested by Mike Frysinger.
> 
> - added some comment for the env_id variable in common_cmd_nvedit.c
> - moved some variables in fn scope instead of file scope
> - NetInitLoop now static void
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>
> ---
> changes since v1:
> - added comments from Mike Frysinger

I'm sorry, but this does not apply any more. Can you please rebase it?

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
I must follow the people.  Am I not their leader? - Benjamin Disraeli

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

* [U-Boot] [PATCH] [PATCH v3] netloop: updates for NetLoop
  2009-04-27 22:09     ` Wolfgang Denk
@ 2009-04-28  5:41       ` Heiko Schocher
  2009-04-28  7:09         ` Ben Warren
  0 siblings, 1 reply; 16+ messages in thread
From: Heiko Schocher @ 2009-04-28  5:41 UTC (permalink / raw)
  To: u-boot

Fix some issues introduced from commit:
2f70c49e5b9813635ad73666aa30f304c7fdeda9
suggested by Mike Frysinger.

- added some comment for the env_id variable in common_cmd_nvedit.c
- moved some variables in fn scope instead of file scope
- NetInitLoop now static void

Signed-off-by: Heiko Schocher <hs@denx.de>
---
changes since v1:
- added comments from Mike Frysinger

changes since v2:
- rebased against current head, commit
  28afe0160f87ff74574150d703055a965f91422a
---
 common/cmd_nvedit.c |    7 +++++++
 net/eth.c           |    5 ++---
 net/net.c           |    7 +++----
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 163765a..3ee971a 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -77,6 +77,13 @@ SPI_FLASH|MG_DISK|NVRAM|NOWHERE}
 static const unsigned long baudrate_table[] = CONFIG_SYS_BAUDRATE_TABLE;
 #define	N_BAUDRATES (sizeof(baudrate_table) / sizeof(baudrate_table[0]))

+/*
+ * This variable is incremented on each do_setenv (), so it can
+ * be used via get_env_id() as an indication, if the environment
+ * has changed or not. So it is possible to reread an environment
+ * variable only if the environment was changed ... done so for
+ * example in NetInitLoop()
+ */
 static int env_id = 1;

 int get_env_id (void)
diff --git a/net/eth.c b/net/eth.c
index c6fa5b9..8940ebf 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -57,9 +57,6 @@ int eth_setenv_enetaddr(char *name, const uchar *enetaddr)

 #if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI)

-static char *act = NULL;
-static int  env_changed_id = 0;
-
 /*
  * CPU and board-specific Ethernet initializations.  Aliased function
  * signals caller to move on
@@ -471,6 +468,8 @@ void eth_try_another(int first_restart)
 #ifdef CONFIG_NET_MULTI
 void eth_set_current(void)
 {
+	static char *act = NULL;
+	static int  env_changed_id = 0;
 	struct eth_device* old_current;
 	int	env_id;

diff --git a/net/net.c b/net/net.c
index b8648bd..5637cf5 100644
--- a/net/net.c
+++ b/net/net.c
@@ -209,8 +209,6 @@ uchar		NetArpWaitPacketBuf[PKTSIZE_ALIGN + PKTALIGN];
 ulong		NetArpWaitTimerStart;
 int		NetArpWaitTry;

-int		env_changed_id = 0;
-
 void ArpRequest (void)
 {
 	int i;
@@ -278,9 +276,10 @@ void ArpTimeoutCheck(void)
 	}
 }

-int
+static void
 NetInitLoop(proto_t protocol)
 {
+	static int env_changed_id = 0;
 	bd_t *bd = gd->bd;
 	int env_id = get_env_id ();

@@ -295,7 +294,7 @@ NetInitLoop(proto_t protocol)
 		env_changed_id = env_id;
 	}

-	return 0;
+	return;
 }

 /**********************************************************************/
-- 
1.6.0.6

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

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

* [U-Boot] [PATCH] [PATCH v3] netloop: updates for NetLoop
  2009-04-28  7:09         ` Ben Warren
@ 2009-04-28  6:21           ` Heiko Schocher
  2009-04-28  6:36           ` [U-Boot] [PATCH v4] " Heiko Schocher
  1 sibling, 0 replies; 16+ messages in thread
From: Heiko Schocher @ 2009-04-28  6:21 UTC (permalink / raw)
  To: u-boot

Hello Ben,

Ben Warren wrote:
> Heiko Schocher wrote:
>> Fix some issues introduced from commit:
>> 2f70c49e5b9813635ad73666aa30f304c7fdeda9
>> suggested by Mike Frysinger.
>>
>> - added some comment for the env_id variable in common_cmd_nvedit.c
>> - moved some variables in fn scope instead of file scope
>> - NetInitLoop now static void
>>
>> Signed-off-by: Heiko Schocher <hs@denx.de>
>>   
> Please put your real e-mail address here.

Ups, sorry, send a new one ...

> Also, can you please verify that everything still works fine when this
> patch is applied to net/next?  It has Michael Zaidman's "NetLoop
> initialization bug" fix applied.

This patch from Michael is also in actual u-boot.git, so I tested
my patch with actual u-boot.git, on a mpc8xx, mpc82xx and on a mpc83xx
based board, without showing the bug which Michael's patch fixed, so
it seems to work fine.

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] 16+ messages in thread

* [U-Boot] [PATCH v4] netloop: updates for NetLoop
  2009-04-28  7:09         ` Ben Warren
  2009-04-28  6:21           ` Heiko Schocher
@ 2009-04-28  6:36           ` Heiko Schocher
  2009-04-28 17:22             ` Ben Warren
  2009-05-15 19:18             ` Wolfgang Denk
  1 sibling, 2 replies; 16+ messages in thread
From: Heiko Schocher @ 2009-04-28  6:36 UTC (permalink / raw)
  To: u-boot

Fix some issues introduced from commit:
2f70c49e5b9813635ad73666aa30f304c7fdeda9
suggested by Mike Frysinger.

- added some comment for the env_id variable in common_cmd_nvedit.c
- moved some variables in fn scope instead of file scope
- NetInitLoop now static void

Signed-off-by: Heiko Schocher <hs@denx.de>
---
changes since v1:
- added comments from Mike Frysinger

changes since v2:
- rebased against current head, commit
  28afe0160f87ff74574150d703055a965f91422a

changes since v3:
- corrected my EMail address, as Ben Warren suggested.

 common/cmd_nvedit.c |    7 +++++++
 net/eth.c           |    5 ++---
 net/net.c           |    7 +++----
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 163765a..3ee971a 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -77,6 +77,13 @@ SPI_FLASH|MG_DISK|NVRAM|NOWHERE}
 static const unsigned long baudrate_table[] = CONFIG_SYS_BAUDRATE_TABLE;
 #define	N_BAUDRATES (sizeof(baudrate_table) / sizeof(baudrate_table[0]))

+/*
+ * This variable is incremented on each do_setenv (), so it can
+ * be used via get_env_id() as an indication, if the environment
+ * has changed or not. So it is possible to reread an environment
+ * variable only if the environment was changed ... done so for
+ * example in NetInitLoop()
+ */
 static int env_id = 1;

 int get_env_id (void)
diff --git a/net/eth.c b/net/eth.c
index c6fa5b9..8940ebf 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -57,9 +57,6 @@ int eth_setenv_enetaddr(char *name, const uchar *enetaddr)

 #if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI)

-static char *act = NULL;
-static int  env_changed_id = 0;
-
 /*
  * CPU and board-specific Ethernet initializations.  Aliased function
  * signals caller to move on
@@ -471,6 +468,8 @@ void eth_try_another(int first_restart)
 #ifdef CONFIG_NET_MULTI
 void eth_set_current(void)
 {
+	static char *act = NULL;
+	static int  env_changed_id = 0;
 	struct eth_device* old_current;
 	int	env_id;

diff --git a/net/net.c b/net/net.c
index b8648bd..5637cf5 100644
--- a/net/net.c
+++ b/net/net.c
@@ -209,8 +209,6 @@ uchar		NetArpWaitPacketBuf[PKTSIZE_ALIGN + PKTALIGN];
 ulong		NetArpWaitTimerStart;
 int		NetArpWaitTry;

-int		env_changed_id = 0;
-
 void ArpRequest (void)
 {
 	int i;
@@ -278,9 +276,10 @@ void ArpTimeoutCheck(void)
 	}
 }

-int
+static void
 NetInitLoop(proto_t protocol)
 {
+	static int env_changed_id = 0;
 	bd_t *bd = gd->bd;
 	int env_id = get_env_id ();

@@ -295,7 +294,7 @@ NetInitLoop(proto_t protocol)
 		env_changed_id = env_id;
 	}

-	return 0;
+	return;
 }

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

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

* [U-Boot] [PATCH] [PATCH v3] netloop: updates for NetLoop
  2009-04-28  5:41       ` [U-Boot] [PATCH] [PATCH v3] " Heiko Schocher
@ 2009-04-28  7:09         ` Ben Warren
  2009-04-28  6:21           ` Heiko Schocher
  2009-04-28  6:36           ` [U-Boot] [PATCH v4] " Heiko Schocher
  0 siblings, 2 replies; 16+ messages in thread
From: Ben Warren @ 2009-04-28  7:09 UTC (permalink / raw)
  To: u-boot

Hi Heiko,

Heiko Schocher wrote:
> Fix some issues introduced from commit:
> 2f70c49e5b9813635ad73666aa30f304c7fdeda9
> suggested by Mike Frysinger.
>
> - added some comment for the env_id variable in common_cmd_nvedit.c
> - moved some variables in fn scope instead of file scope
> - NetInitLoop now static void
>
> Signed-off-by: Heiko Schocher <hs@denx.de>
>   
Please put your real e-mail address here.

Also, can you please verify that everything still works fine when this 
patch is applied to net/next?  It has Michael Zaidman's "NetLoop 
initialization bug" fix applied.

thanks,
Ben

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

* [U-Boot] [PATCH v4] netloop: updates for NetLoop
  2009-04-28  6:36           ` [U-Boot] [PATCH v4] " Heiko Schocher
@ 2009-04-28 17:22             ` Ben Warren
  2009-05-15 19:18               ` Wolfgang Denk
  2009-05-15 19:18             ` Wolfgang Denk
  1 sibling, 1 reply; 16+ messages in thread
From: Ben Warren @ 2009-04-28 17:22 UTC (permalink / raw)
  To: u-boot

Wolfgang,

Heiko Schocher wrote:
> Fix some issues introduced from commit:
> 2f70c49e5b9813635ad73666aa30f304c7fdeda9
> suggested by Mike Frysinger.
>
> - added some comment for the env_id variable in common_cmd_nvedit.c
> - moved some variables in fn scope instead of file scope
> - NetInitLoop now static void
>
> Signed-off-by: Heiko Schocher <hs@denx.de>
>   
Acked-by: Ben Warren <biggerbadderben@gmail.com>
> ---
> changes since v1:
> - added comments from Mike Frysinger
>
> changes since v2:
> - rebased against current head, commit
>   28afe0160f87ff74574150d703055a965f91422a
>
> changes since v3:
> - corrected my EMail address, as Ben Warren suggested.
>
>  common/cmd_nvedit.c |    7 +++++++
>  net/eth.c           |    5 ++---
>  net/net.c           |    7 +++----
>  3 files changed, 12 insertions(+), 7 deletions(-)
>
> diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
> index 163765a..3ee971a 100644
> --- a/common/cmd_nvedit.c
> +++ b/common/cmd_nvedit.c
> @@ -77,6 +77,13 @@ SPI_FLASH|MG_DISK|NVRAM|NOWHERE}
>  static const unsigned long baudrate_table[] = CONFIG_SYS_BAUDRATE_TABLE;
>  #define	N_BAUDRATES (sizeof(baudrate_table) / sizeof(baudrate_table[0]))
>
> +/*
> + * This variable is incremented on each do_setenv (), so it can
> + * be used via get_env_id() as an indication, if the environment
> + * has changed or not. So it is possible to reread an environment
> + * variable only if the environment was changed ... done so for
> + * example in NetInitLoop()
> + */
>  static int env_id = 1;
>
>  int get_env_id (void)
> diff --git a/net/eth.c b/net/eth.c
> index c6fa5b9..8940ebf 100644
> --- a/net/eth.c
> +++ b/net/eth.c
> @@ -57,9 +57,6 @@ int eth_setenv_enetaddr(char *name, const uchar *enetaddr)
>
>  #if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI)
>
> -static char *act = NULL;
> -static int  env_changed_id = 0;
> -
>  /*
>   * CPU and board-specific Ethernet initializations.  Aliased function
>   * signals caller to move on
> @@ -471,6 +468,8 @@ void eth_try_another(int first_restart)
>  #ifdef CONFIG_NET_MULTI
>  void eth_set_current(void)
>  {
> +	static char *act = NULL;
> +	static int  env_changed_id = 0;
>  	struct eth_device* old_current;
>  	int	env_id;
>
> diff --git a/net/net.c b/net/net.c
> index b8648bd..5637cf5 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -209,8 +209,6 @@ uchar		NetArpWaitPacketBuf[PKTSIZE_ALIGN + PKTALIGN];
>  ulong		NetArpWaitTimerStart;
>  int		NetArpWaitTry;
>
> -int		env_changed_id = 0;
> -
>  void ArpRequest (void)
>  {
>  	int i;
> @@ -278,9 +276,10 @@ void ArpTimeoutCheck(void)
>  	}
>  }
>
> -int
> +static void
>  NetInitLoop(proto_t protocol)
>  {
> +	static int env_changed_id = 0;
>  	bd_t *bd = gd->bd;
>  	int env_id = get_env_id ();
>
> @@ -295,7 +294,7 @@ NetInitLoop(proto_t protocol)
>  		env_changed_id = env_id;
>  	}
>
> -	return 0;
> +	return;
>  }
>
>  /**********************************************************************/
>   
Please apply directly.

regards,
Ben

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

* [U-Boot] [PATCH v4] netloop: updates for NetLoop
  2009-04-28  6:36           ` [U-Boot] [PATCH v4] " Heiko Schocher
  2009-04-28 17:22             ` Ben Warren
@ 2009-05-15 19:18             ` Wolfgang Denk
  1 sibling, 0 replies; 16+ messages in thread
From: Wolfgang Denk @ 2009-05-15 19:18 UTC (permalink / raw)
  To: u-boot

Dear Heiko Schocher,

In message <49F6A3DB.2020907@denx.de> you wrote:
> Fix some issues introduced from commit:
> 2f70c49e5b9813635ad73666aa30f304c7fdeda9
> suggested by Mike Frysinger.
> 
> - added some comment for the env_id variable in common_cmd_nvedit.c
> - moved some variables in fn scope instead of file scope
> - NetInitLoop now static void
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>
> ---
> changes since v1:
> - added comments from Mike Frysinger
> 
> changes since v2:
> - rebased against current head, commit
>   28afe0160f87ff74574150d703055a965f91422a
> 
> changes since v3:
> - corrected my EMail address, as Ben Warren suggested.
> 
>  common/cmd_nvedit.c |    7 +++++++
>  net/eth.c           |    5 ++---
>  net/net.c           |    7 +++----
>  3 files changed, 12 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
Business is like a wheelbarrow. Nothing ever happens until you  start
pushing.

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

* [U-Boot] [PATCH v4] netloop: updates for NetLoop
  2009-04-28 17:22             ` Ben Warren
@ 2009-05-15 19:18               ` Wolfgang Denk
  0 siblings, 0 replies; 16+ messages in thread
From: Wolfgang Denk @ 2009-05-15 19:18 UTC (permalink / raw)
  To: u-boot

Dear Ben Warren,

In message <49F73B55.50603@gmail.com> you wrote:
> 
> Heiko Schocher wrote:
> > Fix some issues introduced from commit:
> > 2f70c49e5b9813635ad73666aa30f304c7fdeda9
> > suggested by Mike Frysinger.
> >
> > - added some comment for the env_id variable in common_cmd_nvedit.c
> > - moved some variables in fn scope instead of file scope
> > - NetInitLoop now static void
> >
> > Signed-off-by: Heiko Schocher <hs@denx.de>
> >   
> Acked-by: Ben Warren <biggerbadderben@gmail.com>
...
> Please apply directly.

Done, 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 complexity of software is an essential property, not an  acciden-
tal  one. Hence, descriptions of a software entity that abstract away
its complexity often abstract away its essence.    - Fred Brooks, Jr.

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

end of thread, other threads:[~2009-05-15 19:18 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-25 12:40 [U-Boot] [PATCH] netloop: updates for NetLoop Heiko Schocher
2009-02-25 17:01 ` Mike Frysinger
2009-02-26  7:16   ` [U-Boot] [PATCH v2] " Heiko Schocher
2009-02-26  8:47     ` Mike Frysinger
2009-04-03 21:57     ` Wolfgang Denk
2009-04-03 23:28       ` Michael Zaidman
2009-04-24 19:45       ` Wolfgang Denk
2009-04-24 23:41         ` Ben Warren
2009-04-27 22:09     ` Wolfgang Denk
2009-04-28  5:41       ` [U-Boot] [PATCH] [PATCH v3] " Heiko Schocher
2009-04-28  7:09         ` Ben Warren
2009-04-28  6:21           ` Heiko Schocher
2009-04-28  6:36           ` [U-Boot] [PATCH v4] " Heiko Schocher
2009-04-28 17:22             ` Ben Warren
2009-05-15 19:18               ` Wolfgang Denk
2009-05-15 19:18             ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.