diff mbox series

scsi: lpfc: remove redundant initialization to variable rc

Message ID 20200507203111.64709-1-colin.king@canonical.com (mailing list archive)
State Mainlined
Commit 6e27a86aed9760780666b062abbcf5e1408e8376
Headers show
Series scsi: lpfc: remove redundant initialization to variable rc | expand

Commit Message

Colin King May 7, 2020, 8:31 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

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")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/lpfc/lpfc_attr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin K. Petersen May 12, 2020, 3:28 a.m. UTC | #1
On Thu, 7 May 2020 21:31:11 +0100, Colin King wrote:

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

Patch

diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index 1354c141d614..87ac8ac0f72a 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -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]))