diff mbox series

scsi: 3w-xxx: Remove redundant initialization of variable retval

Message ID 20211013182834.137410-1-colin.king@canonical.com (mailing list archive)
State Accepted
Headers show
Series scsi: 3w-xxx: Remove redundant initialization of variable retval | expand

Commit Message

Colin King Oct. 13, 2021, 6:28 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The variable retvasl is being initialized with a value that is never
read, it is being updated immediately afterwards. The assignment is
redundant and can be removed.

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

Comments

Martin K. Petersen Oct. 17, 2021, 2:29 a.m. UTC | #1
Colin,

> The variable retvasl is being initialized with a value that is never
> read, it is being updated immediately afterwards. The assignment is
> redundant and can be removed.

Applied to 5.16/scsi-staging, thanks!
Martin K. Petersen Oct. 21, 2021, 3:42 a.m. UTC | #2
On Wed, 13 Oct 2021 19:28:34 +0100, Colin King wrote:

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

Applied to 5.16/scsi-queue, thanks!

[1/1] scsi: 3w-xxx: Remove redundant initialization of variable retval
      https://git.kernel.org/mkp/scsi/c/8ecfb16c9be2
diff mbox series

Patch

diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
index 4ee485ab2714..e2f8a7a95d9b 100644
--- a/drivers/scsi/3w-xxxx.c
+++ b/drivers/scsi/3w-xxxx.c
@@ -2252,7 +2252,7 @@  static int tw_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
 {
 	struct Scsi_Host *host = NULL;
 	TW_Device_Extension *tw_dev;
-	int retval = -ENODEV;
+	int retval;
 
 	retval = pci_enable_device(pdev);
 	if (retval) {