Skip to contentSkip to conversation

scsi: snic: remove unused xfer_len variable

PATCH Applied Tom Rix 2 participants 3 messages Mar 28, 2023 – Apr 12, 2023

Subsystems (2)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 scsi: snic: remove unused xfer_len variable

clang with W=1 reports drivers/scsi/snic/snic_scsi.c:490:6: error: variable
'xfer_len' set but not used [-Werror,-Wunused-but-set-variable]

        u64 xfer_len = 0;
            ^

This variable is not used so remove it.

---
 drivers/scsi/snic/snic_scsi.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/scsi/snic/snic_scsi.c +1 -6
index 961af6fc21bc..c50ede326cc4 100644
@@ -487,7 +487,6 @@ snic_process_icmnd_cmpl_status(struct snic *snic,
 			       struct scsi_cmnd *sc)
 {
 	u8 scsi_stat = icmnd_cmpl->scsi_status;
-	u64 xfer_len = 0;
 	int ret = 0;
 
 	/* Mark the IO as complete */
@@ -496,15 +495,11 @@ snic_process_icmnd_cmpl_status(struct snic *snic,
 	if (likely(cmpl_stat == SNIC_STAT_IO_SUCCESS)) {
 		sc->result = (DID_OK << 16) | scsi_stat;
 
-		xfer_len = scsi_bufflen(sc);
-
 		/* Update SCSI Cmd with resid value */
 		scsi_set_resid(sc, le32_to_cpu(icmnd_cmpl->resid));
 
-		if (icmnd_cmpl->flags & SNIC_ICMND_CMPL_UNDR_RUN) {
-			xfer_len -= le32_to_cpu(icmnd_cmpl->resid);
+		if (icmnd_cmpl->flags & SNIC_ICMND_CMPL_UNDR_RUN)
 			atomic64_inc(&snic->s_stats.misc.io_under_run);
-		}
 
 		if (icmnd_cmpl->scsi_status == SAM_STAT_TASK_SET_FULL)
 			atomic64_inc(&snic->s_stats.misc.qfull);
Signature · 1 line
2.27.0
#1 lore raw

Tom,

Quoted 6 lines

clang with W=1 reports drivers/scsi/snic/snic_scsi.c:490:6: error: variable
'xfer_len' set but not used [-Werror,-Wunused-but-set-variable]

        u64 xfer_len = 0;
            ^

This variable is not used so remove it.

Applied to 6.4/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#2 lore raw
In reply to Tom Rix
Quoted 8 lines · Tom Rix

clang with W=1 reports drivers/scsi/snic/snic_scsi.c:490:6: error: variable
'xfer_len' set but not used [-Werror,-Wunused-but-set-variable]

        u64 xfer_len = 0;
            ^

This variable is not used so remove it.

[...]

Applied to 6.4/scsi-queue, thanks!

[1/1] scsi: snic: remove unused xfer_len variable

      https://git.kernel.org/mkp/scsi/c/4e0966a48291
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering