* [PATCH][next] scsi: bnx2fc: remove redundant assignment to variable i
@ 2024-04-15 10:43 Colin Ian King
2024-04-25 1:13 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2024-04-15 10:43 UTC (permalink / raw)
To: Saurav Kashyap, Javed Hasan, GR-QLogic-Storage-Upstream,
James E . J . Bottomleye, Martin K . Petersen, linux-scsi
Cc: kernel-janitors, linux-kernel
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]
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
drivers/scsi/bnx2fc/bnx2fc_tgt.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/scsi/bnx2fc/bnx2fc_tgt.c b/drivers/scsi/bnx2fc/bnx2fc_tgt.c
index d91659811eb3..eb3209103312 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_tgt.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_tgt.c
@@ -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;
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH][next] scsi: bnx2fc: remove redundant assignment to variable i
2024-04-15 10:43 [PATCH][next] scsi: bnx2fc: remove redundant assignment to variable i Colin Ian King
@ 2024-04-25 1:13 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2024-04-25 1:13 UTC (permalink / raw)
To: Colin Ian King
Cc: Saurav Kashyap, Javed Hasan, GR-QLogic-Storage-Upstream,
James E . J . Bottomleye, Martin K . Petersen, linux-scsi,
kernel-janitors, linux-kernel
Colin,
> 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!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-04-25 1:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-15 10:43 [PATCH][next] scsi: bnx2fc: remove redundant assignment to variable i Colin Ian King
2024-04-25 1:13 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).