Skip to contentSkip to conversation

scsi: qla2xxx: Remove redundant assignment to rval

PATCH Applied Jiapeng Chong 2 participants 3 messages May 10, 2021 – May 26, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: qla2xxx: Remove redundant assignment to rval

Variable rval is set to QLA_SUCCESS, but this value is never read as it is overwritten later on, hence it is a redundant assignment and can be removed.

Clean up the following clang-analyzer warning:

drivers/scsi/qla2xxx/qla_init.c:4359:2: warning: Value stored to 'rval' is never read [clang-analyzer-deadcode.DeadStores].

---
 drivers/scsi/qla2xxx/qla_init.c | 2 --
 1 file changed, 2 deletions(-)
drivers/scsi/qla2xxx/qla_init.c +0 -2
index 0de2505..eb82531 100644
@@ -4356,8 +4356,6 @@ void qla_init_iocb_limit(scsi_qla_host_t *vha)
 	if (IS_QLAFX00(vha->hw))
 		return qlafx00_fw_ready(vha);
 
-	rval = QLA_SUCCESS;
-
 	/* Time to wait for loop down */
 	if (IS_P3P_TYPE(ha))
 		min_wait = 30;
Signature · 1 line
1.8.3.1
#1 lore raw

Jiapeng,

Quoted 3 lines

Variable rval is set to QLA_SUCCESS, but this value is never read as it is overwritten later on, hence it is a redundant assignment and can be removed.

Applied to 5.14/scsi-staging, thanks!

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

Variable rval is set to QLA_SUCCESS, but this value is never read as it is overwritten later on, hence it is a redundant assignment and can be removed.

Clean up the following clang-analyzer warning:

drivers/scsi/qla2xxx/qla_init.c:4359:2: warning: Value stored to 'rval' is never read [clang-analyzer-deadcode.DeadStores].

Applied to 5.14/scsi-queue, thanks!

[1/1] scsi: qla2xxx: Remove redundant assignment to rval

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