diff mbox series

[net-next] net: mventa: remove unused variable 'dummy' in mvneta_mib_counters_clear()

Message ID 1600482411-15559-1-git-send-email-zhangchangzhong@huawei.com
State New
Headers show
Series [net-next] net: mventa: remove unused variable 'dummy' in mvneta_mib_counters_clear() | expand

Commit Message

Zhang Changzhong Sept. 19, 2020, 2:26 a.m. UTC
Fixes the following W=1 kernel build warning(s):

drivers/net/ethernet/marvell/mvneta.c:754:6: warning:
 variable 'dummy' set but not used [-Wunused-but-set-variable]
  754 |  u32 dummy;
      |      ^~~~~

This variable is not used in function mvneta_mib_counters_clear(), so
remove it to avoid build warning.

Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
---
 drivers/net/ethernet/marvell/mvneta.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

David Miller Sept. 20, 2020, 9:18 p.m. UTC | #1
From: Zhang Changzhong <zhangchangzhong@huawei.com>

Date: Sat, 19 Sep 2020 10:26:51 +0800

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

> 

> drivers/net/ethernet/marvell/mvneta.c:754:6: warning:

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

>   754 |  u32 dummy;

>       |      ^~~~~

> 

> This variable is not used in function mvneta_mib_counters_clear(), so

> remove it to avoid build warning.

> 

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


Applied.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index f75e05e..4694242 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -751,13 +751,12 @@  static void mvneta_txq_inc_put(struct mvneta_tx_queue *txq)
 static void mvneta_mib_counters_clear(struct mvneta_port *pp)
 {
 	int i;
-	u32 dummy;
 
 	/* Perform dummy reads from MIB counters */
 	for (i = 0; i < MVNETA_MIB_LATE_COLLISION; i += 4)
-		dummy = mvreg_read(pp, (MVNETA_MIB_COUNTERS_BASE + i));
-	dummy = mvreg_read(pp, MVNETA_RX_DISCARD_FRAME_COUNT);
-	dummy = mvreg_read(pp, MVNETA_OVERRUN_FRAME_COUNT);
+		mvreg_read(pp, (MVNETA_MIB_COUNTERS_BASE + i));
+	mvreg_read(pp, MVNETA_RX_DISCARD_FRAME_COUNT);
+	mvreg_read(pp, MVNETA_OVERRUN_FRAME_COUNT);
 }
 
 /* Get System Network Statistics */