Skip to contentSkip to conversation

scsi: bnx2fc: remove redundant assignment to variable i

PATCH Applied Colin Ian King 2 participants 2 messages Apr 15, 2024 – Apr 25, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: bnx2fc: remove redundant assignment to variable i

The variable i is being assigned a value that is never read, the following code path via the label ofld_err never refers to the variable. The assignment is redundant and can be removed.

Cleans up clang scan warning:
drivers/scsi/bnx2fc/bnx2fc_tgt.c:132:5: warning: Value stored to 'i' is never read [deadcode.DeadStores]

---
 drivers/scsi/bnx2fc/bnx2fc_tgt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/scsi/bnx2fc/bnx2fc_tgt.c +1 -3
index d91659811eb3..eb3209103312 100644
@@ -128,10 +128,8 @@ static void bnx2fc_offload_session(struct fcoe_port *port,
 			BNX2FC_TGT_DBG(tgt, "ctx_alloc_failure, "
 				"retry ofld..%d\n", i++);
 			msleep_interruptible(1000);
-			if (i > 3) {
-				i = 0;
+			if (i > 3)
 				goto ofld_err;
-			}
 			goto retry_ofld;
 		}
 		goto ofld_err;
Signature · 1 line
2.39.2
#1 lore raw

Colin,

Quoted 3 lines

The variable i is being assigned a value that is never read, the following code path via the label ofld_err never refers to the variable. The assignment is redundant and can be removed.

Applied to 6.10/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering