[U-Boot] E1000 build warnings

Wolfgang Denk wd at denx.de
Fri Nov 4 17:47:04 CET 2011


Dear Roy, dear Kyle,

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]
e1000.c: In function 'e1000_reset_hw':
e1000.c:1373:11: warning: variable 'icr' set but not used [-Wunused-but-set-variable]
e1000.c: In function 'e1000_phy_init_script':
e1000.c:4395:11: warning: variable 'ret_val' set but not used [-Wunused-but-set-variable]


I'm especially concerned about the last warning (the others should be
straightforward to fix). The code reads:

...
4402                 /* Save off the current value of register 0x2F5B to be
4403                  * restored at the end of this routine. */
4404                 ret_val = e1000_read_phy_reg(hw, 0x2F5B, &phy_saved_data);
...

However, no such restore gets ever done.

AFAICT this is your code, Roy.  Please check and fix.

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
One possible reason that things aren't going  according  to  plan  is
that there never was a plan in the first place.


More information about the U-Boot mailing list