Re: [U-Boot] [PATCH v2] drivers/net/e1000.c: Fix GCC 4.6 build warnings

2011-12-20 Thread Wolfgang Denk
Dear Anatolij Gustschin,

In message <1324402599-781-1-git-send-email-ag...@denx.de> you wrote:
> 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 
> Cc: Kyle Moffett 
> ---
> v2:
>  - use is_valid_ether_addr() for the check as suggested
>by Kyle Moffett
> 
>  drivers/net/e1000.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

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: w...@denx.de
If some day we are defeated, well, war has  its  fortunes,  good  and
bad.
-- Commander Kor, "Errand of Mercy", stardate 3201.7
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] drivers/net/e1000.c: Fix GCC 4.6 build warnings

2011-12-20 Thread Moffett, Kyle D
On Dec 20, 2011, at 12:36, Anatolij Gustschin wrote:
> 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 
> Cc: Kyle Moffett 

Looks great, thanks!

Acked-by: Kyle Moffett 

Cheers,
Kyle Moffett

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

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] drivers/net/e1000.c: Fix GCC 4.6 build warnings

2011-12-20 Thread Anatolij Gustschin
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 
Cc: Kyle Moffett 
---
v2:
 - use is_valid_ether_addr() for the check as suggested
   by Kyle Moffett

 drivers/net/e1000.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c
index 6b71bd9..e726f39 100644
--- a/drivers/net/e1000.c
+++ b/drivers/net/e1000.c
@@ -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);
-- 
1.7.5.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot