All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: pm8001: Remove redundant initialization of variable rv
@ 2021-08-04 14:33 Colin King
  2021-08-10  3:47 ` Martin K. Petersen
  2021-08-17  3:17 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2021-08-04 14:33 UTC (permalink / raw)
  To: Jack Wang, James E . J . Bottomley, Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The variable rv is being initialized with a value that is never
read, it is being updated later on. The assignment is redundant and
can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/pm8001/pm8001_hwi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
index 17c0f26e683a..63690508313b 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.c
+++ b/drivers/scsi/pm8001/pm8001_hwi.c
@@ -1323,7 +1323,7 @@ int pm8001_mpi_build_cmd(struct pm8001_hba_info *pm8001_ha,
 	void *pMessage;
 	unsigned long flags;
 	int q_index = circularQ - pm8001_ha->inbnd_q_tbl;
-	int rv = -1;
+	int rv;
 
 	WARN_ON(q_index >= PM8001_MAX_INB_NUM);
 	spin_lock_irqsave(&circularQ->iq_lock, flags);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: pm8001: Remove redundant initialization of variable rv
  2021-08-04 14:33 [PATCH] scsi: pm8001: Remove redundant initialization of variable rv Colin King
@ 2021-08-10  3:47 ` Martin K. Petersen
  2021-08-17  3:17 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-08-10  3:47 UTC (permalink / raw)
  To: Colin King
  Cc: Jack Wang, James E . J . Bottomley, Martin K . Petersen,
	linux-scsi, kernel-janitors, linux-kernel


Colin,

> The variable rv is being initialized with a value that is never read,
> it is being updated later on. The assignment is redundant and can be
> removed.

Applied to 5.15/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: pm8001: Remove redundant initialization of variable rv
  2021-08-04 14:33 [PATCH] scsi: pm8001: Remove redundant initialization of variable rv Colin King
  2021-08-10  3:47 ` Martin K. Petersen
@ 2021-08-17  3:17 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-08-17  3:17 UTC (permalink / raw)
  To: Jack Wang, Colin King, James E . J . Bottomley, linux-scsi
  Cc: Martin K . Petersen, linux-kernel, kernel-janitors

On Wed, 4 Aug 2021 15:33:19 +0100, Colin King wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable rv is being initialized with a value that is never
> read, it is being updated later on. The assignment is redundant and
> can be removed.
> 
> 
> [...]

Applied to 5.15/scsi-queue, thanks!

[1/1] scsi: pm8001: Remove redundant initialization of variable rv
      https://git.kernel.org/mkp/scsi/c/83da6ad6f97e

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-17  3:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-04 14:33 [PATCH] scsi: pm8001: Remove redundant initialization of variable rv Colin King
2021-08-10  3:47 ` Martin K. Petersen
2021-08-17  3:17 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.