* [PATCH][next] scsi: target: iscsi: remove unused variable xfer_len
@ 2024-03-07 10:45 Colin Ian King
2024-03-10 22:01 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2024-03-07 10:45 UTC (permalink / raw)
To: Martin K . Petersen, Mike Christie, linux-scsi, target-devel
Cc: kernel-janitors, linux-kernel
The variable xfer_len is being initialized and incremented but it is
never actually referenced in any other way. The variable is redundant
and can be removed.
Cleans up clang scan build warning:
drivers/target/iscsi/iscsi_target_erl1.c:586:45: warning: variable
'xfer_len' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
drivers/target/iscsi/iscsi_target_erl1.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/target/iscsi/iscsi_target_erl1.c b/drivers/target/iscsi/iscsi_target_erl1.c
index 679720021183..d9a6242264b7 100644
--- a/drivers/target/iscsi/iscsi_target_erl1.c
+++ b/drivers/target/iscsi/iscsi_target_erl1.c
@@ -583,7 +583,7 @@ int iscsit_dataout_datapduinorder_no_fbit(
struct iscsi_pdu *pdu)
{
int i, send_recovery_r2t = 0, recovery = 0;
- u32 length = 0, offset = 0, pdu_count = 0, xfer_len = 0;
+ u32 length = 0, offset = 0, pdu_count = 0;
struct iscsit_conn *conn = cmd->conn;
struct iscsi_pdu *first_pdu = NULL;
@@ -596,7 +596,6 @@ int iscsit_dataout_datapduinorder_no_fbit(
if (cmd->pdu_list[i].seq_no == pdu->seq_no) {
if (!first_pdu)
first_pdu = &cmd->pdu_list[i];
- xfer_len += cmd->pdu_list[i].length;
pdu_count++;
} else if (pdu_count)
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH][next] scsi: target: iscsi: remove unused variable xfer_len
2024-03-07 10:45 [PATCH][next] scsi: target: iscsi: remove unused variable xfer_len Colin Ian King
@ 2024-03-10 22:01 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2024-03-10 22:01 UTC (permalink / raw)
To: Colin Ian King
Cc: Martin K . Petersen, Mike Christie, linux-scsi, target-devel,
kernel-janitors, linux-kernel
Colin,
> The variable xfer_len is being initialized and incremented but it is
> never actually referenced in any other way. The variable is redundant
> and can be removed.
Applied to 6.9/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-03-10 22:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-07 10:45 [PATCH][next] scsi: target: iscsi: remove unused variable xfer_len Colin Ian King
2024-03-10 22:01 ` 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 NNTP newsgroup(s).