diff mbox series

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

Message ID 1615272064-42109-1-git-send-email-yang.lee@linux.alibaba.com (mailing list archive)
State Accepted
Headers show
Series scsi: 3w-sas: remove unneeded variable 'retval' | expand

Commit Message

Yang Li March 9, 2021, 6:41 a.m. UTC
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 <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/scsi/3w-sas.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Martin K. Petersen March 19, 2021, 3:46 a.m. UTC | #1
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
diff mbox series

Patch

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 */