diff mbox series

scsi: fnic: remove redundant assignment of variable rc

Message ID 20190813132349.8720-1-colin.king@canonical.com (mailing list archive)
State Mainlined
Commit 9730ddfb123db3f37ace7571176661257712c99b
Headers show
Series scsi: fnic: remove redundant assignment of variable rc | expand

Commit Message

Colin King Aug. 13, 2019, 1:23 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Variable ret is initialized to a value that is never read and it is
re-assigned later and immediatetly returns. Clean up the code by
removing rc and just returning 0.

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

Comments

Karan Tilak Kumar (kartilak) Aug. 15, 2019, 12:33 a.m. UTC | #1
Acked-by:   Karan Tilak Kumar   <kartilak@cisco.com>

-----Original Message-----
From: Colin King <colin.king@canonical.com> 
Sent: Tuesday, August 13, 2019 6:24 AM
To: Satish Kharat (satishkh) <satishkh@cisco.com>; Sesidhar Baddela (sebaddel) <sebaddel@cisco.com>; Karan Tilak Kumar (kartilak) <kartilak@cisco.com>; James E . J . Bottomley <jejb@linux.ibm.com>; Martin K . Petersen <martin.petersen@oracle.com>; linux-scsi@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
Subject: [PATCH] scsi: fnic: remove redundant assignment of variable rc

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

Variable ret is initialized to a value that is never read and it is
re-assigned later and immediatetly returns. Clean up the code by
removing rc and just returning 0.

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

diff --git a/drivers/scsi/fnic/fnic_debugfs.c b/drivers/scsi/fnic/fnic_debugfs.c
index 21991c99db7c..13f7d88d6e57 100644
--- a/drivers/scsi/fnic/fnic_debugfs.c
+++ b/drivers/scsi/fnic/fnic_debugfs.c
@@ -52,7 +52,6 @@ static struct fc_trace_flag_type *fc_trc_flag;
  */
 int fnic_debugfs_init(void)
 {
-	int rc = -1;
 	fnic_trace_debugfs_root = debugfs_create_dir("fnic", NULL);
 
 	fnic_stats_debugfs_root = debugfs_create_dir("statistics",
@@ -70,8 +69,7 @@ int fnic_debugfs_init(void)
 		fc_trc_flag->fc_clear = 4;
 	}
 
-	rc = 0;
-	return rc;
+	return 0;
 }
 
 /*
Martin K. Petersen Aug. 15, 2019, 2:12 a.m. UTC | #2
Colin,

> Variable ret is initialized to a value that is never read and it is
> re-assigned later and immediatetly returns. Clean up the code by
> removing rc and just returning 0.

Applied to 5.4/scsi-queue. Thanks!
diff mbox series

Patch

diff --git a/drivers/scsi/fnic/fnic_debugfs.c b/drivers/scsi/fnic/fnic_debugfs.c
index 21991c99db7c..13f7d88d6e57 100644
--- a/drivers/scsi/fnic/fnic_debugfs.c
+++ b/drivers/scsi/fnic/fnic_debugfs.c
@@ -52,7 +52,6 @@  static struct fc_trace_flag_type *fc_trc_flag;
  */
 int fnic_debugfs_init(void)
 {
-	int rc = -1;
 	fnic_trace_debugfs_root = debugfs_create_dir("fnic", NULL);
 
 	fnic_stats_debugfs_root = debugfs_create_dir("statistics",
@@ -70,8 +69,7 @@  int fnic_debugfs_init(void)
 		fc_trc_flag->fc_clear = 4;
 	}
 
-	rc = 0;
-	return rc;
+	return 0;
 }
 
 /*