Fix breakage in SMC EEPROM standalone applications
PATCH 1/1 Fix breakage in SMC EEPROM standalone applications
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.
--- examples/standalone/smc91111_eeprom.c | 2 -- examples/standalone/smc911x_eeprom.c | 8 -------- 2 files changed, 0 insertions(+), 10 deletions(-)
examples/standalone/smc91111_eeprom.c +0 -2
@@ -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
examples/standalone/smc911x_eeprom.c +0 -8
@@ -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 */
Signature · 1 line
1.6.0.4
PATCH 1/1 Fix breakage in SMC EEPROM standalone applications
Quoted 4 lines · Ben Warren
Commit
6a45e384955262882375a2785426dc65aeb636c4(Makegetenv_IPaddr()global) inadvertently added ' #include "net.h" ' to the standalone programs, creating duplicate definitions of 'structeth_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
Quoted 45 lines
Signed-off-by Ben Warren<[email protected]>--- examples/standalone/smc91111_eeprom.c | 2 -- examples/standalone/smc911x_eeprom.c | 8 -------- 2 files changed, 0 insertions(+), 10 deletions(-)examples/standalone/smc91111_eeprom.c +0
-2@@ -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 examples/standalone/smc911x_eeprom.c +0
-8@@ -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 */
PATCH 1/1 Fix breakage in SMC EEPROM standalone applications
In reply to Ben Warrenexamples/standalone/smc911x_eeprom.c int smc911x_eeprom(int argc, char *argv[]) · line 320
Quoted 8 lines · On Monday 18 January 2010 14:35:31 Ben Warren wrote:
examples/standalone/smc911x_eeprom.c +0
-1@@ -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 ...
-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
Wolfgang Denk
AppliedPATCH 1/1 Fix breakage in SMC EEPROM standalone applications
In reply to Ben WarrenDear Ben Warren,
Quoted 10 lines · In message <[email protected]> you…
Commit
6a45e384955262882375a2785426dc65aeb636c4(Makegetenv_IPaddr()global) inadvertently added ' #include "net.h" ' to the standalone programs, creating duplicate definitions of 'structeth_device'. This patch removes the local definitions and removes other code that breaks due to the change in definition.Signed-off-by Ben Warren <[email protected]>--- 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
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
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_A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 Fix breakage in SMC EEPROM standalone applications
Hi Tom,
Quoted 21 lines · Tom
Quoted 8 lines · Ben Warren
Commit
6a45e384955262882375a2785426dc65aeb636c4(Makegetenv_IPaddr()global)
inadvertently added ' #include "net.h" ' to the standalone programs, creating
duplicate definitions of 'structeth_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 targetsOld :
err/versatile.ERRsmc91111_eeprom.c:33: error: redefinition of 'struct
eth_device' make[1]: *** [.../build/examples/standalone/smc91111_eeprom.o] Error 1New
Quoted 9 lines
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 1Tom
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
PATCH 1/1 Fix breakage in SMC EEPROM standalone applications
Quoted 29 lines · On Monday 18 January 2010 18:15:32 Ben Warren wrote:
Quoted 19 lines · Tom
Quoted 8 lines · Ben Warren
Commit
6a45e384955262882375a2785426dc65aeb636c4(Makegetenv_IPaddr()global)
inadvertently added ' #include "net.h" ' to the standalone programs, creating
duplicate definitions of 'structeth_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 targetsOld :
err/versatile.ERRsmc91111_eeprom.c:33: error: redefinition of 'struct
eth_device' make[1]: *** [.../build/examples/standalone/smc91111_eeprom.o] Error 1Quoted 8 lines
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
Quoted 7 lines
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