2021-03-09 06:44:45

by Yang Li

[permalink] [raw]
Subject: [PATCH] scsi: 3w-sas: remove unneeded variable 'retval'

Fix the following coccicheck warning:
./drivers/scsi/3w-sas.c:866:5-11: Unneeded variable: "retval". Return
"1" on line 898

Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Yang Li <[email protected]>
---
drivers/scsi/3w-sas.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c
index 3db0e42..eae706e 100644
--- a/drivers/scsi/3w-sas.c
+++ b/drivers/scsi/3w-sas.c
@@ -863,7 +863,6 @@ static int twl_fill_sense(TW_Device_Extension *tw_dev, int i, int request_id, in
TW_Command_Full *full_command_packet;
unsigned short error;
char *error_str;
- int retval = 1;

header = tw_dev->sense_buffer_virt[i];
full_command_packet = tw_dev->command_packet_virt[request_id];
@@ -895,7 +894,7 @@ static int twl_fill_sense(TW_Device_Extension *tw_dev, int i, int request_id, in
goto out;
}
out:
- return retval;
+ return 1;
} /* End twl_fill_sense() */

/* This function will free up device extension resources */
--
1.8.3.1


2021-03-19 03:51:18

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH] scsi: 3w-sas: remove unneeded variable 'retval'

On Tue, 9 Mar 2021 14:41:04 +0800, Yang Li wrote:

> Fix the following coccicheck warning:
> ./drivers/scsi/3w-sas.c:866:5-11: Unneeded variable: "retval". Return
> "1" on line 898

Applied to 5.13/scsi-queue, thanks!

[1/1] scsi: 3w-sas: remove unneeded variable 'retval'
https://git.kernel.org/mkp/scsi/c/2af0bf34ae1f

--
Martin K. Petersen Oracle Linux Engineering