Skip to content

Commit 4e0966a

Browse files
Tom Rixmartinkpetersen
authored andcommitted
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>
1 parent 7866e03 commit 4e0966a

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

drivers/scsi/snic/snic_scsi.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,6 @@ snic_process_icmnd_cmpl_status(struct snic *snic,
487487
struct scsi_cmnd *sc)
488488
{
489489
u8 scsi_stat = icmnd_cmpl->scsi_status;
490-
u64 xfer_len = 0;
491490
int ret = 0;
492491

493492
/* Mark the IO as complete */
@@ -496,15 +495,11 @@ snic_process_icmnd_cmpl_status(struct snic *snic,
496495
if (likely(cmpl_stat == SNIC_STAT_IO_SUCCESS)) {
497496
sc->result = (DID_OK << 16) | scsi_stat;
498497

499-
xfer_len = scsi_bufflen(sc);
500-
501498
/* Update SCSI Cmd with resid value */
502499
scsi_set_resid(sc, le32_to_cpu(icmnd_cmpl->resid));
503500

504-
if (icmnd_cmpl->flags & SNIC_ICMND_CMPL_UNDR_RUN) {
505-
xfer_len -= le32_to_cpu(icmnd_cmpl->resid);
501+
if (icmnd_cmpl->flags & SNIC_ICMND_CMPL_UNDR_RUN)
506502
atomic64_inc(&snic->s_stats.misc.io_under_run);
507-
}
508503

509504
if (icmnd_cmpl->scsi_status == SAM_STAT_TASK_SET_FULL)
510505
atomic64_inc(&snic->s_stats.misc.qfull);

0 commit comments

Comments
 (0)