diff mbox series

scsi: snic: Remove unnecessary condition to simplify the code

Message ID 20200925060754.156599-1-jingxiangfeng@huawei.com
State New
Headers show
Series scsi: snic: Remove unnecessary condition to simplify the code | expand

Commit Message

Jing Xiangfeng Sept. 25, 2020, 6:07 a.m. UTC
ret is always zero or an error in this code path. So the assignment to
ret is redundant, and the code jumping to a label is unneed.
Let's remove them to simplify the code. No functional changes.

Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
---
 drivers/scsi/snic/snic_scsi.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Karan Tilak Kumar (kartilak) Sept. 25, 2020, 6:58 a.m. UTC | #1
Looks good to me.

Signed off by: Karan Tilak Kumar <kartilak@cisco.com>

Regards,
Karan

-----Original Message-----
From: Jing Xiangfeng <jingxiangfeng@huawei.com> 

Sent: Thursday, September 24, 2020 11:08 PM
To: Karan Tilak Kumar (kartilak) <kartilak@cisco.com>; Sesidhar Baddela (sebaddel) <sebaddel@cisco.com>; jejb@linux.ibm.com; martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org; jingxiangfeng@huawei.com
Subject: [PATCH] scsi: snic: Remove unnecessary condition to simplify the code

ret is always zero or an error in this code path. So the assignment to ret is redundant, and the code jumping to a label is unneed.
Let's remove them to simplify the code. No functional changes.

Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>

---
 drivers/scsi/snic/snic_scsi.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/scsi/snic/snic_scsi.c b/drivers/scsi/snic/snic_scsi.c index b3650c989ed4..0c2f31b8ea05 100644
--- a/drivers/scsi/snic/snic_scsi.c
+++ b/drivers/scsi/snic/snic_scsi.c
@@ -1387,10 +1387,6 @@ snic_issue_tm_req(struct snic *snic,
 	}
 
 	ret = snic_queue_itmf_req(snic, tmreq, sc, tmf, req_id);
-	if (ret)
-		goto tmreq_err;
-
-	ret = 0;
 
 tmreq_err:
 	if (ret) {
--
2.17.1
Martin K. Petersen Oct. 3, 2020, 1:15 a.m. UTC | #2
Jing,

> ret is always zero or an error in this code path. So the assignment to

> ret is redundant, and the code jumping to a label is unneed.

> Let's remove them to simplify the code. No functional changes.


Applied to 5.10/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering
Martin K. Petersen Oct. 7, 2020, 3:47 a.m. UTC | #3
On Fri, 25 Sep 2020 14:07:54 +0800, Jing Xiangfeng wrote:

> ret is always zero or an error in this code path. So the assignment to

> ret is redundant, and the code jumping to a label is unneed.

> Let's remove them to simplify the code. No functional changes.


Applied to 5.10/scsi-queue, thanks!

[1/1] scsi: snic: Remove unnecessary condition
      https://git.kernel.org/mkp/scsi/c/2a7869d6c9a1

-- 
Martin K. Petersen	Oracle Linux Engineering
diff mbox series

Patch

diff --git a/drivers/scsi/snic/snic_scsi.c b/drivers/scsi/snic/snic_scsi.c
index b3650c989ed4..0c2f31b8ea05 100644
--- a/drivers/scsi/snic/snic_scsi.c
+++ b/drivers/scsi/snic/snic_scsi.c
@@ -1387,10 +1387,6 @@  snic_issue_tm_req(struct snic *snic,
 	}
 
 	ret = snic_queue_itmf_req(snic, tmreq, sc, tmf, req_id);
-	if (ret)
-		goto tmreq_err;
-
-	ret = 0;
 
 tmreq_err:
 	if (ret) {