linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: snic: Remove redundant assignment to variable ret
@ 2021-08-06 11:23 Colin King
  2021-08-10  3:24 ` Martin K. Petersen
  2021-08-17  3:17 ` Martin K. Petersen
  0 siblings, 2 replies; 5+ messages in thread
From: Colin King @ 2021-08-06 11:23 UTC (permalink / raw)
  To: Karan Tilak Kumar, Sesidhar Baddela, James E . J . Bottomley,
	Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

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

The variable ret is being initialized with a value that is never read,
the assignment is redundant and can be removed.

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

diff --git a/drivers/scsi/snic/snic_scsi.c b/drivers/scsi/snic/snic_scsi.c
index 6dd0ff188bb4..92f5b65c2a27 100644
--- a/drivers/scsi/snic/snic_scsi.c
+++ b/drivers/scsi/snic/snic_scsi.c
@@ -2383,7 +2383,7 @@ snic_host_reset(struct scsi_cmnd *sc)
 {
 	struct Scsi_Host *shost = sc->device->host;
 	u32 start_time  = jiffies;
-	int ret = FAILED;
+	int ret;
 
 	SNIC_SCSI_DBG(shost,
 		      "host reset:sc %p sc_cmd 0x%x req %p tag %d flags 0x%llx\n",
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH] scsi: snic: remove redundant assignment to variable ret
@ 2019-07-31 22:49 Colin King
  2019-08-06 13:17 ` Dan Carpenter
  0 siblings, 1 reply; 5+ messages in thread
From: Colin King @ 2019-07-31 22:49 UTC (permalink / raw)
  To: Karan Tilak Kumar, Sesidhar Baddela, James E . J . Bottomley,
	Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

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

Variable ret is being assigned with a value that is never read as
there is return statement immediately afterwards.  The assignment
is redundant and hence can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/snic/snic_disc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/scsi/snic/snic_disc.c b/drivers/scsi/snic/snic_disc.c
index e9ccfb97773f..d89c75991323 100644
--- a/drivers/scsi/snic/snic_disc.c
+++ b/drivers/scsi/snic/snic_disc.c
@@ -261,8 +261,6 @@ snic_tgt_create(struct snic *snic, struct snic_tgt_id *tgtid)
 	tgt = kzalloc(sizeof(*tgt), GFP_KERNEL);
 	if (!tgt) {
 		SNIC_HOST_ERR(snic->shost, "Failure to allocate snic_tgt.\n");
-		ret = -ENOMEM;
-
 		return tgt;
 	}
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-17  3:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-06 11:23 [PATCH] scsi: snic: Remove redundant assignment to variable ret Colin King
2021-08-10  3:24 ` Martin K. Petersen
2021-08-17  3:17 ` Martin K. Petersen
  -- strict thread matches above, loose matches on Subject: below --
2019-07-31 22:49 [PATCH] scsi: snic: remove " Colin King
2019-08-06 13:17 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).