Skip to contentSkip to conversation

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

PATCH Applied Colin King 2 participants 3 messages Oct 13, 2021 – Oct 21, 2021

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

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

From: Colin Ian King <[email protected]>

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")

---
 drivers/scsi/3w-xxxx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/3w-xxxx.c +1 -1
index 4ee485ab2714..e2f8a7a95d9b 100644
@@ -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) {
Signature · 1 line
2.32.0
#1 lore raw

Colin,

Quoted 3 lines

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!

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

From: Colin Ian King <[email protected]>

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
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering