2024-02-08 12:48:00

by Colin Ian King

[permalink] [raw]
Subject: [PATCH][next] drivers: net: xgene: remove redundant assignment to variable offset

The variable offset is being initialized with a value that is never
read, it is being re-assigned later on in either path of an if
statement before being used. The initialization is redundant and
can be removed.

Cleans up clang scan build warning:
drivers/net/ethernet/apm/xgene/xgene_enet_cle.c:736:2: warning: Value
stored to 'offset' is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <[email protected]>
---
drivers/net/ethernet/apm/xgene/xgene_enet_cle.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_cle.c b/drivers/net/ethernet/apm/xgene/xgene_enet_cle.c
index de5464322311..8f104642897b 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_cle.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_cle.c
@@ -733,7 +733,6 @@ static int xgene_cle_setup_rss(struct xgene_enet_pdata *pdata)
u32 offset, val = 0;
int i, ret = 0;

- offset = CLE_PORT_OFFSET;
for (i = 0; i < cle->parsers; i++) {
if (cle->active_parser != PARSER_ALL)
offset = cle->active_parser * CLE_PORT_OFFSET;
--
2.39.2