From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Sun, 30 Oct 2011 20:19:49 -0400 Subject: [U-Boot] [PATCH 12/18] GCC4.6: Squash warnings in smsc95xx.c In-Reply-To: <201110310045.44028.marek.vasut@gmail.com> References: <1319535604-20831-1-git-send-email-marek.vasut@gmail.com> <201110301859.48522.vapier@gentoo.org> <201110310045.44028.marek.vasut@gmail.com> Message-ID: <201110302019.51065.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 Sunday 30 October 2011 19:45:43 Marek Vasut wrote: > > On Sunday 30 October 2011 16:48:50 Marek Vasut wrote: > > > > On Tuesday 25 October 2011 05:39:58 Marek Vasut wrote: > > > > > --- a/drivers/usb/eth/smsc95xx.c > > > > > +++ b/drivers/usb/eth/smsc95xx.c > > > > > > > > > > - addr_lo = cpu_to_le32(*((u32 *)eth->enetaddr)); > > > > > + addr_lo = cpu_to_le32(*eth->enetaddr); > > > > > > > > pretty sure this is wrong. enetaddr is a uchar[], so your code now > > > > reads only 1 byte instead of 4. > > > > > > > > that said, this code also seems to not be endian safe ... > > > > > > It's good anyone actually cares to properly review. Anyway, why does > > > noone actually care to fix all the damn warnings in their drivers > > > before submitting them in the first place ?! > > > > the strict alias warnings you are hitting show up only in newer > > compilers. so i'm sure at the time of their development/submission, they > > didn't exist. > > This is a different driver than that armada100_fec.c. ok ? the original 12/18 patch said: smsc95xx.c: In function 'smsc95xx_write_hwaddr': smsc95xx.c:380:2: warning: dereferencing type-punned pointer will break strict-aliasing rules -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/20111030/1493da06/attachment.pgp