* [PATCH] scsi: snic: Remove unnecessary condition to simplify the code
@ 2020-09-25 6:07 Jing Xiangfeng
2020-09-25 6:58 ` Karan Tilak Kumar (kartilak)
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jing Xiangfeng @ 2020-09-25 6:07 UTC (permalink / raw)
To: kartilak, sebaddel, jejb, martin.petersen
Cc: linux-scsi, linux-kernel, jingxiangfeng
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [PATCH] scsi: snic: Remove unnecessary condition to simplify the code
2020-09-25 6:07 [PATCH] scsi: snic: Remove unnecessary condition to simplify the code Jing Xiangfeng
@ 2020-09-25 6:58 ` Karan Tilak Kumar (kartilak)
2020-10-03 1:15 ` Martin K. Petersen
2020-10-07 3:47 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Karan Tilak Kumar (kartilak) @ 2020-09-25 6:58 UTC (permalink / raw)
To: Jing Xiangfeng, Sesidhar Baddela (sebaddel), jejb, martin.petersen
Cc: linux-scsi, linux-kernel
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: snic: Remove unnecessary condition to simplify the code
2020-09-25 6:07 [PATCH] scsi: snic: Remove unnecessary condition to simplify the code Jing Xiangfeng
2020-09-25 6:58 ` Karan Tilak Kumar (kartilak)
@ 2020-10-03 1:15 ` Martin K. Petersen
2020-10-07 3:47 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2020-10-03 1:15 UTC (permalink / raw)
To: Jing Xiangfeng
Cc: kartilak, sebaddel, jejb, martin.petersen, linux-scsi, linux-kernel
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: snic: Remove unnecessary condition to simplify the code
2020-09-25 6:07 [PATCH] scsi: snic: Remove unnecessary condition to simplify the code Jing Xiangfeng
2020-09-25 6:58 ` Karan Tilak Kumar (kartilak)
2020-10-03 1:15 ` Martin K. Petersen
@ 2020-10-07 3:47 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2020-10-07 3:47 UTC (permalink / raw)
To: Jing Xiangfeng, jejb, kartilak, sebaddel
Cc: Martin K . Petersen, linux-kernel, linux-scsi
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-10-07 3:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-25 6:07 [PATCH] scsi: snic: Remove unnecessary condition to simplify the code Jing Xiangfeng
2020-09-25 6:58 ` Karan Tilak Kumar (kartilak)
2020-10-03 1:15 ` Martin K. Petersen
2020-10-07 3:47 ` Martin K. Petersen
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).