From patchwork Sat Nov 19 18:59:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 126604 X-Patchwork-Delegate: prafulla@marvell.com 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 28295B7212 for ; Sun, 20 Nov 2011 05:59:48 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DF925287FA; Sat, 19 Nov 2011 19:59:43 +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 ehAcioL2X6+b; Sat, 19 Nov 2011 19:59:43 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 97A3C2876A; Sat, 19 Nov 2011 19:59:41 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9BAD12876A for ; Sat, 19 Nov 2011 19:59:39 +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 3ZsxqGw59ZAG for ; Sat, 19 Nov 2011 19:59:38 +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 0FFD928694 for ; Sat, 19 Nov 2011 19:59:36 +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 077B2188A166; Sat, 19 Nov 2011 20:02:11 +0100 (CET) X-Auth-Info: lWkEfpEUOsR3jXb9H6Ym8EVl8n+75iBBqHHPFWx3Tyw= Received: from localhost (p4FC46DF7.dip.t-dialin.net [79.196.109.247]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA id 4B6891C00067; Sat, 19 Nov 2011 19:59:35 +0100 (CET) From: Anatolij Gustschin To: u-boot@lists.denx.de Date: Sat, 19 Nov 2011 19:59:36 +0100 Message-Id: <1321729176-5520-1-git-send-email-agust@denx.de> X-Mailer: git-send-email 1.7.1 Subject: [U-Boot] [PATCH] drivers/net/mvgbe.c: Fix GCC 4.6 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: mvgbe.c: In function 'mvgbe_send': mvgbe.c:555:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] mvgbe.c: In function 'mvgbe_recv': mvgbe.c:640:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] Signed-off-by: Anatolij Gustschin Cc: Prafulla Wadaskar Acked-By: Prafulla Wadaskar --- drivers/net/mvgbe.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c index fd13428..de7cdd7 100644 --- a/drivers/net/mvgbe.c +++ b/drivers/net/mvgbe.c @@ -531,6 +531,7 @@ static int mvgbe_send(struct eth_device *dev, void *dataptr, struct mvgbe_txdesc *p_txdesc = dmvgbe->p_txdesc; void *p = (void *)dataptr; u32 cmd_sts; + u32 txuq0_reg_addr; /* Copy buffer if it's misaligned */ if ((u32) dataptr & 0x07) { @@ -552,7 +553,8 @@ static int mvgbe_send(struct eth_device *dev, void *dataptr, p_txdesc->byte_cnt = datasize; /* Set this tc desc as zeroth TXUQ */ - MVGBE_REG_WR(regs->tcqdp[TXUQ], (u32) p_txdesc); + txuq0_reg_addr = (u32)®s->tcqdp[TXUQ]; + writel((u32) p_txdesc, txuq0_reg_addr); /* ensure tx desc writes above are performed before we start Tx DMA */ isb(); @@ -583,6 +585,7 @@ static int mvgbe_recv(struct eth_device *dev) struct mvgbe_rxdesc *p_rxdesc_curr = dmvgbe->p_rxdesc_curr; u32 cmd_sts; u32 timeout = 0; + u32 rxdesc_curr_addr; /* wait untill rx packet available or timeout */ do { @@ -637,8 +640,8 @@ static int mvgbe_recv(struct eth_device *dev) p_rxdesc_curr->buf_size = PKTSIZE_ALIGN; p_rxdesc_curr->byte_cnt = 0; - writel((unsigned)p_rxdesc_curr->nxtdesc_p, - (u32) &dmvgbe->p_rxdesc_curr); + rxdesc_curr_addr = (u32)&dmvgbe->p_rxdesc_curr; + writel((unsigned)p_rxdesc_curr->nxtdesc_p, rxdesc_curr_addr); return 0; }