2020-09-25 06:09:33

by Jing Xiangfeng

[permalink] [raw]
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 <[email protected]>
---
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


Subject: RE: [PATCH] scsi: snic: Remove unnecessary condition to simplify the code

Looks good to me.

Signed off by: Karan Tilak Kumar <[email protected]>

Regards,
Karan

-----Original Message-----
From: Jing Xiangfeng <[email protected]>
Sent: Thursday, September 24, 2020 11:08 PM
To: Karan Tilak Kumar (kartilak) <[email protected]>; Sesidhar Baddela (sebaddel) <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]
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 <[email protected]>
---
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

2020-10-03 01:18:36

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH] scsi: snic: Remove unnecessary condition to simplify the code


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

2020-10-07 03:52:40

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH] scsi: snic: Remove unnecessary condition to simplify the code

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