[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1619691982-90657-1-git-send-email-jiapeng.chong@linux.alibaba.com>
Date: Thu, 29 Apr 2021 18:26:22 +0800
From: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
To: nicolas.ferre@...rochip.com
Cc: claudiu.beznea@...rochip.com, davem@...emloft.net, kuba@...nel.org,
linux@...linux.org.uk, palmer@...belt.com,
paul.walmsley@...ive.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org,
Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
Subject: [PATCH] net: macb: Remove redundant assignment to w0
Variable w0 is set to zero but these values is not used as it is
overwritten later on, hence redundant assignment can be removed.
Cleans up the following clang-analyzer warning:
drivers/net/ethernet/cadence/macb_main.c:3265:3: warning: Value stored
to 'w0' is never read [clang-analyzer-deadcode.DeadStores].
drivers/net/ethernet/cadence/macb_main.c:3251:3: warning: Value stored
to 'w0' is never read [clang-analyzer-deadcode.DeadStores].
Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
---
drivers/net/ethernet/cadence/macb_main.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 0f6a6cb..741b2e3 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -3248,7 +3248,6 @@ static void gem_prog_cmp_regs(struct macb *bp, struct ethtool_rx_flow_spec *fs)
/* ignore field if any masking set */
if (tp4sp_m->ip4src == 0xFFFFFFFF) {
/* 1st compare reg - IP source address */
- w0 = 0;
w1 = 0;
w0 = tp4sp_v->ip4src;
w1 = GEM_BFINS(T2DISMSK, 1, w1); /* 32-bit compare */
@@ -3262,7 +3261,6 @@ static void gem_prog_cmp_regs(struct macb *bp, struct ethtool_rx_flow_spec *fs)
/* ignore field if any masking set */
if (tp4sp_m->ip4dst == 0xFFFFFFFF) {
/* 2nd compare reg - IP destination address */
- w0 = 0;
w1 = 0;
w0 = tp4sp_v->ip4dst;
w1 = GEM_BFINS(T2DISMSK, 1, w1); /* 32-bit compare */
--
1.8.3.1
Powered by blists - more mailing lists