mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: 3w-sas: remove unneeded variable 'retval'
@ 2021-03-09  6:41 Yang Li
  2021-03-19  3:46 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2021-03-09  6:41 UTC (permalink / raw)
  To: aradford; +Cc: jejb, martin.petersen, linux-scsi, linux-kernel, Yang Li

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(-)

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] scsi: 3w-sas: remove unneeded variable 'retval'
  2021-03-09  6:41 [PATCH] scsi: 3w-sas: remove unneeded variable 'retval' Yang Li
@ 2021-03-19  3:46 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2021-03-19  3:46 UTC (permalink / raw)
  To: aradford, Yang Li; +Cc: Martin K . Petersen, linux-scsi, linux-kernel, jejb

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-19  3:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-09  6:41 [PATCH] scsi: 3w-sas: remove unneeded variable 'retval' Yang Li
2021-03-19  3:46 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®