From patchwork Tue Dec 20 15:49:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 132442 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 89798B6F74 for ; Wed, 21 Dec 2011 02:49:57 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C40262810D; Tue, 20 Dec 2011 16:49:54 +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 YM1wCnMzgGdK; Tue, 20 Dec 2011 16:49:54 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 04C2E28161; Tue, 20 Dec 2011 16:49:53 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4E0BE28161 for ; Tue, 20 Dec 2011 16:49:51 +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 mZf7ft7H50nK for ; Tue, 20 Dec 2011 16:49:49 +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.9]) by theia.denx.de (Postfix) with ESMTP id 650F528159 for ; Tue, 20 Dec 2011 16:49:47 +0100 (CET) Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id A18941C0F584 for ; Tue, 20 Dec 2011 16:49:47 +0100 (CET) X-Auth-Info: NdBgAHpHw/yhg3IphMwRZBFgytwLwBBxJSSe0uNPDiM= 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 7250E1C001A2 for ; Tue, 20 Dec 2011 16:49:47 +0100 (CET) From: Anatolij Gustschin To: u-boot@lists.denx.de Date: Tue, 20 Dec 2011 16:49:47 +0100 Message-Id: <1324396187-25157-1-git-send-email-agust@denx.de> X-Mailer: git-send-email 1.7.1 Subject: [U-Boot] [PATCH] 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 --- drivers/net/e1000.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c index 6b71bd9..54f6425 100644 --- a/drivers/net/e1000.c +++ b/drivers/net/e1000.c @@ -45,6 +45,7 @@ tested on both gig copper and gig fiber boards */ #include "e1000.h" +#include #define TOUT_LOOP 100000 @@ -1146,7 +1147,8 @@ 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 (get_unaligned_be32(nic->enetaddr) == 0 || + get_unaligned_be32(nic->enetaddr) == ~0) { unsigned char fb_mac[NODE_ADDRESS_SIZE] = CONFIG_E1000_FALLBACK_MAC; memcpy (nic->enetaddr, fb_mac, NODE_ADDRESS_SIZE);