Skip to contentSkip to conversation

scsi: lpfc: remove redundant initialization to variable rc

PATCH Applied Colin King 2 participants 2 messages May 7, 2020 – May 12, 2020

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 scsi: lpfc: remove redundant initialization to variable rc

From: Colin Ian King <[email protected]>

The variable rc is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/scsi/lpfc/lpfc_attr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/lpfc/lpfc_attr.c +1 -1
index 1354c141d614..87ac8ac0f72a 100644
@@ -4877,7 +4877,7 @@ lpfc_request_firmware_upgrade_store(struct device *dev,
 	struct Scsi_Host *shost = class_to_shost(dev);
 	struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata;
 	struct lpfc_hba *phba = vport->phba;
-	int val = 0, rc = -EINVAL;
+	int val = 0, rc;
 
 	/* Sanity check on user data */
 	if (!isdigit(buf[0]))
Signature · 1 line
2.25.1
#1 lore raw
Quoted 3 lines · Colin King

The variable rc is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Applied to 5.8/scsi-queue, thanks!

[1/1] scsi: lpfc: Remove redundant initialization to variable rc

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