From patchwork Tue Dec 20 17:36:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 132472 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 61D0DB7063 for ; Wed, 21 Dec 2011 04:37:08 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 419F52812B; Tue, 20 Dec 2011 18:37:06 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id K6nuHbAhYTZ0; Tue, 20 Dec 2011 18:37:05 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 614C22811A; Tue, 20 Dec 2011 18:37:04 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AA4D82811A for ; Tue, 20 Dec 2011 18:37:02 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ngKZa-9eZPCx for ; Tue, 20 Dec 2011 18:37:01 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by theia.denx.de (Postfix) with ESMTP id 50C2128116 for ; Tue, 20 Dec 2011 18:36:59 +0100 (CET) Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id EA79E18000E1; Tue, 20 Dec 2011 18:36:54 +0100 (CET) X-Auth-Info: ob0T1Xf8nWn4D/yI0aWvrxnc4+V1ygxK/srkaoO5z1o= Received: from localhost (p4FDE723E.dip.t-dialin.net [79.222.114.62]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA id 471871C001EF; Tue, 20 Dec 2011 18:36:39 +0100 (CET) From: Anatolij Gustschin To: u-boot@lists.denx.de Date: Tue, 20 Dec 2011 18:36:39 +0100 Message-Id: <1324402599-781-1-git-send-email-agust@denx.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1324396187-25157-1-git-send-email-agust@denx.de> References: <1324396187-25157-1-git-send-email-agust@denx.de> Subject: [U-Boot] [PATCH v2] drivers/net/e1000.c: Fix GCC 4.6 build warnings X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 Acked-by: 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);