]> git.sur5r.net Git - u-boot/commitdiff
drivers/net/e1000.c: Fix GCC 4.6 build warnings
authorAnatolij Gustschin <agust@denx.de>
Tue, 20 Dec 2011 07:36:39 +0000 (07:36 +0000)
committerWolfgang Denk <wd@denx.de>
Tue, 20 Dec 2011 22:21:03 +0000 (23:21 +0100)
Fix:
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]

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Acked-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
drivers/net/e1000.c

index 6b71bd901e22871c5cf2905966fd458d9620333f..e726f398d4f2e87ea560374fa5252fd73a1530be 100644 (file)
@@ -1146,7 +1146,7 @@ e1000_read_mac_addr(struct eth_device *nic)
                nic->enetaddr[5] ^= 1;
 
 #ifdef CONFIG_E1000_FALLBACK_MAC
-       if ( *(u32*)(nic->enetaddr) == 0 || *(u32*)(nic->enetaddr) == ~0 ) {
+       if (!is_valid_ether_addr(nic->enetaddr)) {
                unsigned char fb_mac[NODE_ADDRESS_SIZE] = CONFIG_E1000_FALLBACK_MAC;
 
                memcpy (nic->enetaddr, fb_mac, NODE_ADDRESS_SIZE);