diff mbox series

[net-next] net: dnet: remove unused variable 'tx_status 'in dnet_start_xmit()

Message ID 1600088917-21372-1-git-send-email-zhangchangzhong@huawei.com
State New
Headers show
Series [net-next] net: dnet: remove unused variable 'tx_status 'in dnet_start_xmit() | expand

Commit Message

Zhang Changzhong Sept. 14, 2020, 1:08 p.m. UTC
Fixes the following W=1 kernel build warning(s):

drivers/net/ethernet/dnet.c:510:6: warning:
 variable 'tx_status' set but not used [-Wunused-but-set-variable]
  u32 tx_status, irq_enable;
      ^~~~~~~~~

After commit 4796417417a6 ("dnet: Dave DNET ethernet controller driver
(updated)"), variable 'tx_status' is never used in dnet_start_xmit(),
so removing it to avoid build warning.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
---
 drivers/net/ethernet/dnet.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

David Miller Sept. 14, 2020, 8:42 p.m. UTC | #1
From: Zhang Changzhong <zhangchangzhong@huawei.com>

Date: Mon, 14 Sep 2020 21:08:37 +0800

> Fixes the following W=1 kernel build warning(s):

> 

> drivers/net/ethernet/dnet.c:510:6: warning:

>  variable 'tx_status' set but not used [-Wunused-but-set-variable]

>   u32 tx_status, irq_enable;

>       ^~~~~~~~~

> 

> After commit 4796417417a6 ("dnet: Dave DNET ethernet controller driver

> (updated)"), variable 'tx_status' is never used in dnet_start_xmit(),

> so removing it to avoid build warning.

> 

> Reported-by: Hulk Robot <hulkci@huawei.com>

> Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>


Applied.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/dnet.c b/drivers/net/ethernet/dnet.c
index 3143df9..7f87b0f 100644
--- a/drivers/net/ethernet/dnet.c
+++ b/drivers/net/ethernet/dnet.c
@@ -507,12 +507,12 @@  static netdev_tx_t dnet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 
 	struct dnet *bp = netdev_priv(dev);
-	u32 tx_status, irq_enable;
+	u32 irq_enable;
 	unsigned int i, tx_cmd, wrsz;
 	unsigned long flags;
 	unsigned int *bufp;
 
-	tx_status = dnet_readl(bp, TX_STATUS);
+	dnet_readl(bp, TX_STATUS);
 
 	pr_debug("start_xmit: len %u head %p data %p\n",
 	       skb->len, skb->head, skb->data);
@@ -520,7 +520,7 @@  static netdev_tx_t dnet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	spin_lock_irqsave(&bp->lock, flags);
 
-	tx_status = dnet_readl(bp, TX_STATUS);
+	dnet_readl(bp, TX_STATUS);
 
 	bufp = (unsigned int *)(((unsigned long) skb->data) & ~0x3UL);
 	wrsz = (u32) skb->len + 3;
@@ -542,7 +542,7 @@  static netdev_tx_t dnet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	if (dnet_readl(bp, TX_FIFO_WCNT) > DNET_FIFO_TX_DATA_AF_TH) {
 		netif_stop_queue(dev);
-		tx_status = dnet_readl(bp, INTR_SRC);
+		dnet_readl(bp, INTR_SRC);
 		irq_enable = dnet_readl(bp, INTR_ENB);
 		irq_enable |= DNET_INTR_ENB_TX_FIFOAE;
 		dnet_writel(bp, irq_enable, INTR_ENB);