public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Fix breakage in SMC EEPROM standalone applications
@ 2010-01-18 19:35 Ben Warren
  2010-01-18 19:44 ` Dirk Behme
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Ben Warren @ 2010-01-18 19:35 UTC (permalink / raw)
  To: u-boot

Commit 6a45e384955262882375a2785426dc65aeb636c4 (Make getenv_IPaddr() global)
inadvertently added ' #include "net.h" ' to the standalone programs, creating
duplicate definitions of 'struct eth_device'.  This patch removes the local
definitions and removes other code that breaks due to the change in definition.

Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
---
 examples/standalone/smc91111_eeprom.c |    2 --
 examples/standalone/smc911x_eeprom.c  |    8 --------
 2 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/examples/standalone/smc91111_eeprom.c b/examples/standalone/smc91111_eeprom.c
index 428ea7b..9145763 100644
--- a/examples/standalone/smc91111_eeprom.c
+++ b/examples/standalone/smc91111_eeprom.c
@@ -29,8 +29,6 @@
 
 #include <common.h>
 #include <exports.h>
-/* the smc91111.h gets base addr through eth_device' iobase */
-struct eth_device { unsigned long iobase; };
 #include "../drivers/net/smc91111.h"
 
 #ifndef SMC91111_EEPROM_INIT
diff --git a/examples/standalone/smc911x_eeprom.c b/examples/standalone/smc911x_eeprom.c
index fff3123..104047f 100644
--- a/examples/standalone/smc911x_eeprom.c
+++ b/examples/standalone/smc911x_eeprom.c
@@ -16,13 +16,6 @@
 
 #include <common.h>
 #include <exports.h>
-
-/* the smc911x.h gets base addr through eth_device' iobase */
-struct eth_device {
-	const char *name;
-	unsigned long iobase;
-	void *priv;
-};
 #include "../drivers/net/smc911x.h"
 
 /**
@@ -324,7 +317,6 @@ int smc911x_eeprom(int argc, char *argv[])
 {
 	/* Avoid initializing on stack as gcc likes to call memset() */
 	struct eth_device dev;
-	dev.name = __func__;
 	dev.iobase = CONFIG_SMC911X_BASE;
 
 	/* Print the ABI version */
-- 
1.6.0.4

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

* [U-Boot] [PATCH] Fix breakage in SMC EEPROM standalone applications
  2010-01-18 19:35 [U-Boot] [PATCH] Fix breakage in SMC EEPROM standalone applications Ben Warren
@ 2010-01-18 19:44 ` Dirk Behme
  2010-01-18 22:02 ` Mike Frysinger
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Dirk Behme @ 2010-01-18 19:44 UTC (permalink / raw)
  To: u-boot

On 18.01.2010 20:35, Ben Warren wrote:
> Commit 6a45e384955262882375a2785426dc65aeb636c4 (Make getenv_IPaddr() global)
> inadvertently added ' #include "net.h" ' to the standalone programs, creating
> duplicate definitions of 'struct eth_device'.  This patch removes the local
> definitions and removes other code that breaks due to the change in definition.

Yes, great. This looks better than my proposal to fix this some 
minutes ago :)

Thanks

Dirk

> Signed-off-by: Ben Warren<biggerbadderben@gmail.com>
> ---
>   examples/standalone/smc91111_eeprom.c |    2 --
>   examples/standalone/smc911x_eeprom.c  |    8 --------
>   2 files changed, 0 insertions(+), 10 deletions(-)
>
> diff --git a/examples/standalone/smc91111_eeprom.c b/examples/standalone/smc91111_eeprom.c
> index 428ea7b..9145763 100644
> --- a/examples/standalone/smc91111_eeprom.c
> +++ b/examples/standalone/smc91111_eeprom.c
> @@ -29,8 +29,6 @@
>
>   #include<common.h>
>   #include<exports.h>
> -/* the smc91111.h gets base addr through eth_device' iobase */
> -struct eth_device { unsigned long iobase; };
>   #include "../drivers/net/smc91111.h"
>
>   #ifndef SMC91111_EEPROM_INIT
> diff --git a/examples/standalone/smc911x_eeprom.c b/examples/standalone/smc911x_eeprom.c
> index fff3123..104047f 100644
> --- a/examples/standalone/smc911x_eeprom.c
> +++ b/examples/standalone/smc911x_eeprom.c
> @@ -16,13 +16,6 @@
>
>   #include<common.h>
>   #include<exports.h>
> -
> -/* the smc911x.h gets base addr through eth_device' iobase */
> -struct eth_device {
> -	const char *name;
> -	unsigned long iobase;
> -	void *priv;
> -};
>   #include "../drivers/net/smc911x.h"
>
>   /**
> @@ -324,7 +317,6 @@ int smc911x_eeprom(int argc, char *argv[])
>   {
>   	/* Avoid initializing on stack as gcc likes to call memset() */
>   	struct eth_device dev;
> -	dev.name = __func__;
>   	dev.iobase = CONFIG_SMC911X_BASE;
>
>   	/* Print the ABI version */

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

* [U-Boot] [PATCH] Fix breakage in SMC EEPROM standalone applications
  2010-01-18 19:35 [U-Boot] [PATCH] Fix breakage in SMC EEPROM standalone applications Ben Warren
  2010-01-18 19:44 ` Dirk Behme
@ 2010-01-18 22:02 ` Mike Frysinger
  2010-01-18 23:06 ` Wolfgang Denk
       [not found] ` <4B54D424.304@windriver.com>
  3 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger @ 2010-01-18 22:02 UTC (permalink / raw)
  To: u-boot

On Monday 18 January 2010 14:35:31 Ben Warren wrote:
> --- a/examples/standalone/smc911x_eeprom.c
> +++ b/examples/standalone/smc911x_eeprom.c
> @@ -324,7 +317,6 @@ int smc911x_eeprom(int argc, char *argv[])
>  {
>  	/* Avoid initializing on stack as gcc likes to call memset() */
>  	struct eth_device dev;
> -	dev.name = __func__;
>  	dev.iobase = CONFIG_SMC911X_BASE;

the .name was added because some patch was changing smc911x.h to use it in 
error reporting, but i guess that never made it in as the current header uses 
DRIVERNAME ...

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/20100118/cad176e5/attachment.pgp 

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

* [U-Boot] [PATCH] Fix breakage in SMC EEPROM standalone applications
  2010-01-18 19:35 [U-Boot] [PATCH] Fix breakage in SMC EEPROM standalone applications Ben Warren
  2010-01-18 19:44 ` Dirk Behme
  2010-01-18 22:02 ` Mike Frysinger
@ 2010-01-18 23:06 ` Wolfgang Denk
       [not found] ` <4B54D424.304@windriver.com>
  3 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Denk @ 2010-01-18 23:06 UTC (permalink / raw)
  To: u-boot

Dear Ben Warren,

In message <1263843331-30089-1-git-send-email-biggerbadderben@gmail.com> you wrote:
> Commit 6a45e384955262882375a2785426dc65aeb636c4 (Make getenv_IPaddr() global)
> inadvertently added ' #include "net.h" ' to the standalone programs, creating
> duplicate definitions of 'struct eth_device'.  This patch removes the local
> definitions and removes other code that breaks due to the change in definition.
> 
> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
> ---
>  examples/standalone/smc91111_eeprom.c |    2 --
>  examples/standalone/smc911x_eeprom.c  |    8 --------
>  2 files changed, 0 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
I don't mind criticism. You know me. I've  never  been  one  to  take
offence  at  criticism. No one could say I'm the sort to take offence
at criticism -- Not twice, anyway. Not without blowing bubbles.
                                  - Terry Pratchett, _Witches Abroad_

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

* [U-Boot] [PATCH] Fix breakage in SMC EEPROM standalone applications
       [not found] ` <4B54D424.304@windriver.com>
@ 2010-01-18 23:15   ` Ben Warren
  2010-01-18 23:42     ` Mike Frysinger
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Warren @ 2010-01-18 23:15 UTC (permalink / raw)
  To: u-boot

Hi Tom,

Tom wrote:
> Ben Warren wrote:
>> Commit 6a45e384955262882375a2785426dc65aeb636c4 (Make getenv_IPaddr() 
>> global)
>> inadvertently added ' #include "net.h" ' to the standalone programs, 
>> creating
>> duplicate definitions of 'struct eth_device'.  This patch removes the 
>> local
>> definitions and removes other code that breaks due to the change in 
>> definition.
>
> This patch may need refining.
> I see warnings in a number of arm targets
>
> Old :
> err/versatile.ERR
>
> smc91111_eeprom.c:33: error: redefinition of 'struct eth_device'
> make[1]: *** [.../build/examples/standalone/smc91111_eeprom.o] Error 1
>
> New
>
> err/versatile.ERR
> .../build/examples/standalone/smc91111_eeprom.o: In function 
> `smc91111_eeprom':
> .../u-boot/src/u-boot-arm/examples/standalone/smc91111_eeprom.c:58: 
> undefined reference to `memset'
> make[1]: *** [.../build/examples/standalone/smc91111_eeprom] Error 1
>
> Tom
>
This builds cleanly for me.  I am, however, using an old toolchain (gcc 
4.0.0 from ELDK 4.1).  Do struct member assignments use memset()?  Line 
58 is the closing brace and semicolon in the following:

        struct eth_device dev = {
                .iobase = CONFIG_SMC91111_BASE
        };

regards,
Ben

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

* [U-Boot] [PATCH] Fix breakage in SMC EEPROM standalone applications
  2010-01-18 23:15   ` Ben Warren
@ 2010-01-18 23:42     ` Mike Frysinger
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger @ 2010-01-18 23:42 UTC (permalink / raw)
  To: u-boot

On Monday 18 January 2010 18:15:32 Ben Warren wrote:
> Tom wrote:
> > Ben Warren wrote:
> >> Commit 6a45e384955262882375a2785426dc65aeb636c4 (Make getenv_IPaddr()
> >> global)
> >> inadvertently added ' #include "net.h" ' to the standalone programs,
> >> creating
> >> duplicate definitions of 'struct eth_device'.  This patch removes the
> >> local
> >> definitions and removes other code that breaks due to the change in
> >> definition.
> >
> > This patch may need refining.
> > I see warnings in a number of arm targets
> >
> > Old :
> > err/versatile.ERR
> >
> > smc91111_eeprom.c:33: error: redefinition of 'struct eth_device'
> > make[1]: *** [.../build/examples/standalone/smc91111_eeprom.o] Error 1
> >
> > New
> >
> > err/versatile.ERR
> > .../build/examples/standalone/smc91111_eeprom.o: In function
> > `smc91111_eeprom':
> > .../u-boot/src/u-boot-arm/examples/standalone/smc91111_eeprom.c:58:
> > undefined reference to `memset'
> > make[1]: *** [.../build/examples/standalone/smc91111_eeprom] Error 1
> 
> This builds cleanly for me.  I am, however, using an old toolchain (gcc
> 4.0.0 from ELDK 4.1).  Do struct member assignments use memset()?  Line
> 58 is the closing brace and semicolon in the following:
> 
>         struct eth_device dev = {
>                 .iobase = CONFIG_SMC91111_BASE
>         };

gcc may generate a reference to memset here because it wants to zero the other 
members as an optimization.  this is why the smc911x_eeprom assigns things on 
the stack instead of using the form you show here.  but i doubt this patch 
caused this problem directly.
-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/20100118/de84e307/attachment.pgp 

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

end of thread, other threads:[~2010-01-18 23:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-18 19:35 [U-Boot] [PATCH] Fix breakage in SMC EEPROM standalone applications Ben Warren
2010-01-18 19:44 ` Dirk Behme
2010-01-18 22:02 ` Mike Frysinger
2010-01-18 23:06 ` Wolfgang Denk
     [not found] ` <4B54D424.304@windriver.com>
2010-01-18 23:15   ` Ben Warren
2010-01-18 23:42     ` Mike Frysinger

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