Skip to contentSkip to conversation

scsi: 3w-sas: remove unneeded variable 'retval'

PATCH Applied Yang Li 2 participants 2 messages Mar 9, 2021 – Mar 19, 2021

Subsystems (2)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 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

---
 drivers/scsi/3w-sas.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/3w-sas.c +1 -2
index 3db0e42..eae706e 100644
@@ -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 */
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 3 lines · Yang Li

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
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering