From patchwork Thu Jun 9 12:08:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_Bie=C3=9Fmann?= X-Patchwork-Id: 99740 X-Patchwork-Delegate: info@emk-elektronik.de 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 057DEB6FE2 for ; Thu, 9 Jun 2011 22:09:01 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4446528540; Thu, 9 Jun 2011 14:08:59 +0200 (CEST) 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 YM5W37vIAZcm; Thu, 9 Jun 2011 14:08:59 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3E17528557; Thu, 9 Jun 2011 14:08:57 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DE09328557 for ; Thu, 9 Jun 2011 14:08:54 +0200 (CEST) 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 xOTZ-U2E+pUi for ; Thu, 9 Jun 2011 14:08:54 +0200 (CEST) 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-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by theia.denx.de (Postfix) with ESMTPS id 0BC6228540 for ; Thu, 9 Jun 2011 14:08:52 +0200 (CEST) Received: by fxm15 with SMTP id 15so945631fxm.3 for ; Thu, 09 Jun 2011 05:08:52 -0700 (PDT) Received: by 10.223.61.134 with SMTP id t6mr729005fah.28.1307621332325; Thu, 09 Jun 2011 05:08:52 -0700 (PDT) Received: from azuregos.cs.local (DSL01.212.114.252.242.ip-pool.NEFkom.net [212.114.252.242]) by mx.google.com with ESMTPS id y7sm630899fak.7.2011.06.09.05.08.50 (version=SSLv3 cipher=OTHER); Thu, 09 Jun 2011 05:08:51 -0700 (PDT) From: "=?UTF-8?q?Andreas=20Bie=C3=9Fmann?=" To: u-boot@lists.denx.de Date: Thu, 9 Jun 2011 14:08:46 +0200 Message-Id: <1307621326-17010-1-git-send-email-andreas.devel@gmail.com> X-Mailer: git-send-email 1.7.2.5 References: <1307619188-18655-1-git-send-email-andreas.devel@gmail.com> In-Reply-To: <1307619188-18655-1-git-send-email-andreas.devel@gmail.com> MIME-Version: 1.0 Cc: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= Subject: [U-Boot] [PATCH v2] macb: fix compile warning X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This patch fixes following compile warning: ---8<--- macb.c: In function 'macb_write_hwaddr': macb.c:525:2: warning: dereferencing type-punned pointer will break strict-aliasing rules --->8--- Signed-off-by: Andreas Bießmann Tested-by: Reinhard Meyer --- BEWARE! this patch is only compile tested! changes since v1: - use correct eth_device drivers/net/macb.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 72ea1fc..c63eea9 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -522,9 +522,10 @@ static int macb_write_hwaddr(struct eth_device *dev) u16 hwaddr_top; /* set hardware address */ - hwaddr_bottom = cpu_to_le32(*((u32 *)dev->enetaddr)); + hwaddr_bottom = dev->enetaddr[0] | dev->enetaddr[1] << 8 | + dev->enetaddr[2] << 16 | dev->enetaddr[3] << 24; macb_writel(macb, SA1B, hwaddr_bottom); - hwaddr_top = cpu_to_le16(*((u16 *)(dev->enetaddr + 4))); + hwaddr_top = dev->enetaddr[4] | dev->enetaddr[5] << 8; macb_writel(macb, SA1T, hwaddr_top); return 0; }