diff mbox series

scsi: snici: Remove dead code in snic_dr_clean_pending_req

Message ID 20231019083026.1525366-1-suhui@nfschina.com (mailing list archive)
State Changes Requested
Headers show
Series scsi: snici: Remove dead code in snic_dr_clean_pending_req | expand

Commit Message

Su Hui Oct. 19, 2023, 8:30 a.m. UTC
Value stored to 'ret' is never read, remove it to save space.

Signed-off-by: Su Hui <suhui@nfschina.com>
---
 drivers/scsi/snic/snic_scsi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Dan Carpenter Oct. 19, 2023, 10:09 a.m. UTC | #1
On Thu, Oct 19, 2023 at 04:30:27PM +0800, Su Hui wrote:
> Value stored to 'ret' is never read, remove it to save space.
> 
> Signed-off-by: Su Hui <suhui@nfschina.com>

Could you do this a bit more thouroughly and remove all the
"ret = FAILED;" and "ret = 0;" assignments.  Just "return FAILED;"
and "return 0;" directly.

regards,
dan carpenter
Su Hui Oct. 20, 2023, 1:52 a.m. UTC | #2
On 2023/10/19 18:09, Dan Carpenter wrote:
> On Thu, Oct 19, 2023 at 04:30:27PM +0800, Su Hui wrote:
>> Value stored to 'ret' is never read, remove it to save space.
>>
>> Signed-off-by: Su Hui <suhui@nfschina.com>
> Could you do this a bit more thouroughly and remove all the
> "ret = FAILED;" and "ret = 0;" assignments.  Just "return FAILED;"
> and "return 0;" directly.
Yes, this is better, thanks for your advice.
I will send v2 later.

Su Hui
diff mbox series

Patch

diff --git a/drivers/scsi/snic/snic_scsi.c b/drivers/scsi/snic/snic_scsi.c
index c50ede326cc4..badd0d5640bc 100644
--- a/drivers/scsi/snic/snic_scsi.c
+++ b/drivers/scsi/snic/snic_scsi.c
@@ -1867,11 +1867,8 @@  snic_dr_clean_pending_req(struct snic *snic, struct scsi_cmnd *lr_sc)
 	schedule_timeout(msecs_to_jiffies(100));
 
 	/* Walk through all the cmds and check abts status. */
-	if (snic_is_abts_pending(snic, lr_sc)) {
-		ret = FAILED;
-
+	if (snic_is_abts_pending(snic, lr_sc))
 		goto clean_err;
-	}
 
 	ret = 0;
 	SNIC_SCSI_DBG(snic->shost, "clean_pending_req: Success.\n");