Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Signed-off-by: Tom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/20230328001647.1778448-1-trix@redhat.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Tom Rix and committed by
Martin K. Petersen
4e0966a4 7866e03b

+1 -6
+1 -6
drivers/scsi/snic/snic_scsi.c
··· 487 487 struct scsi_cmnd *sc) 488 488 { 489 489 u8 scsi_stat = icmnd_cmpl->scsi_status; 490 - u64 xfer_len = 0; 491 490 int ret = 0; 492 491 493 492 /* Mark the IO as complete */ ··· 495 496 if (likely(cmpl_stat == SNIC_STAT_IO_SUCCESS)) { 496 497 sc->result = (DID_OK << 16) | scsi_stat; 497 498 498 - xfer_len = scsi_bufflen(sc); 499 - 500 499 /* Update SCSI Cmd with resid value */ 501 500 scsi_set_resid(sc, le32_to_cpu(icmnd_cmpl->resid)); 502 501 503 - if (icmnd_cmpl->flags & SNIC_ICMND_CMPL_UNDR_RUN) { 504 - xfer_len -= le32_to_cpu(icmnd_cmpl->resid); 502 + if (icmnd_cmpl->flags & SNIC_ICMND_CMPL_UNDR_RUN) 505 503 atomic64_inc(&snic->s_stats.misc.io_under_run); 506 - } 507 504 508 505 if (icmnd_cmpl->scsi_status == SAM_STAT_TASK_SET_FULL) 509 506 atomic64_inc(&snic->s_stats.misc.qfull);