From: Michal Simek Date: Fri, 25 Jan 2013 13:46:35 +0000 (+0100) Subject: net: axi_emac: Remove compilation warnings X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d3e188b94a47dadae8e5b898ecef5cf355ab1d23;p=thirdparty%2Fu-boot.git net: axi_emac: Remove compilation warnings Remove compilation warnings: xilinx_axi_emac.c: In function 'setup_phy': xilinx_axi_emac.c:274:26: warning: unused variable 'ret' [-Wunused-variable] xilinx_axi_emac.c:274:6: warning: unused variable 'i' [-Wunused-variable] xilinx_axi_emac.c:273:6: warning: unused variable 'phyreg' [-Wunused-variable] xilinx_axi_emac.c: In function 'axi_dma_init': xilinx_axi_emac.c:484:7: warning: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~' [-Wparentheses] xilinx_axi_emac.c: In function 'axiemac_send': xilinx_axi_emac.c:593:4: warning: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~' [-Wparentheses] Signed-off-by: Michal Simek --- diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c index 97cc21df379..1ff9abf94da 100644 --- a/drivers/net/xilinx_axi_emac.c +++ b/drivers/net/xilinx_axi_emac.c @@ -270,8 +270,7 @@ static void phy_detection(struct eth_device *dev) static int setup_phy(struct eth_device *dev) { #ifdef CONFIG_PHYLIB - u16 phyreg; - u32 i, speed, emmc_reg, ret; + u32 speed, emmc_reg; struct axidma_priv *priv = dev->priv; struct axi_regs *regs = (struct axi_regs *)dev->iobase; struct phy_device *phydev; @@ -479,8 +478,8 @@ static void axi_dma_init(struct eth_device *dev) while (timeout--) { /* Check transmit/receive channel */ /* Reset is done when the reset bit is low */ - if (!(in_be32(&priv->dmatx->control) | - in_be32(&priv->dmarx->control)) + if ((!(in_be32(&priv->dmatx->control) | + in_be32(&priv->dmarx->control))) & XAXIDMA_CR_RESET_MASK) { break; } @@ -589,7 +588,7 @@ static int axiemac_send(struct eth_device *dev, void *ptr, int len) /* Wait for transmission to complete */ debug("axiemac: Waiting for tx to be done\n"); timeout = 200; - while (timeout && (!in_be32(&priv->dmatx->status) & + while (timeout && ((!in_be32(&priv->dmatx->status)) & (XAXIDMA_IRQ_DELAY_MASK | XAXIDMA_IRQ_IOC_MASK))) { timeout--; udelay(1);