From: Mike Frysinger Date: Mon, 18 Jan 2010 18:42:32 -0500 Subject: [U-Boot] [PATCH] Fix breakage in SMC EEPROM standalone applications In-Reply-To: <4B54EB94.3030405@gmail.com> References: <1263843331-30089-1-git-send-email-biggerbadderben@gmail.com> <4B54D424.304@windriver.com> <4B54EB94.3030405@gmail.com> Message-ID: <201001181842.33214.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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