diff mbox series

scsi: qla2xxx: Remove redundant assignment to rval

Message ID 1620643206-127930-1-git-send-email-jiapeng.chong@linux.alibaba.com (mailing list archive)
State Accepted
Headers show
Series scsi: qla2xxx: Remove redundant assignment to rval | expand

Commit Message

Jiapeng Chong May 10, 2021, 10:40 a.m. UTC
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].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/scsi/qla2xxx/qla_init.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Martin K. Petersen May 22, 2021, 2:59 a.m. UTC | #1
Jiapeng,

> 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!
Martin K. Petersen May 26, 2021, 4:07 a.m. UTC | #2
On Mon, 10 May 2021 18:40:06 +0800, Jiapeng Chong wrote:

> 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
diff mbox series

Patch

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 0de2505..eb82531 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -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;