[U-Boot] E1000 build warnings

Moffett, Kyle D Kyle.D.Moffett at boeing.com
Fri Nov 4 21:03:09 CET 2011


On Nov 04, 2011, at 12:47, Wolfgang Denk wrote:
> you have been modifyong the E1000 driver lately so I hope you are in
> the best position to help and fix a number of build warnings.
> 
> For example when building for the MVBC_P board, I get this:
> 
> e1000.c: In function 'e1000_read_mac_addr':
> e1000.c:1149:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
> e1000.c:1149:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

Hmm, I would be inclined to just use "-fno-strict-aliasing" and
"-Wno-strict-aliasing" here.  The Linux kernel does the exact same thing
because strict-aliasing tends to cause arbitrary breakage with things
like memcpy() and network protocol buffers.

Here's one relevant email thread:
  https://lkml.org/lkml/2003/2/25/270

> e1000.c: In function 'e1000_reset_hw':
> e1000.c:1373:11: warning: variable 'icr' set but not used [-Wunused-but-set-variable]

In this case the "icr" variable should just be removed; the register
read is just to clear some read-once bits.  I'll submit a patch next
week to fix this one if nobody else beats me to it.

Cheers,
Kyle Moffett

--
Curious about my work on the Debian powerpcspe port?
I'm keeping a blog here: http://pureperl.blogspot.com/



More information about the U-Boot mailing list