linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] isci: style: remove the unneeded variable: "status".
@ 2020-12-30  7:04 YANG LI
  2021-01-15  4:08 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: YANG LI @ 2020-12-30  7:04 UTC (permalink / raw)
  To: jejb
  Cc: martin.petersen, intel-linux-scu, artur.paszkiewicz, linux-scsi,
	linux-kernel, YANG LI

The variable 'status' is being initialized with SCI_SUCCESS and never 
update later with a new value. The initialization is redundant and can 
be removed.

Signed-off-by: YANG LI <abaci-bugfix@linux.alibaba.com>
Reported-by: Abaci <abaci@linux.alibaba.com>
---
 drivers/scsi/isci/request.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c
index 6e08179..bee1685 100644
--- a/drivers/scsi/isci/request.c
+++ b/drivers/scsi/isci/request.c
@@ -2103,8 +2103,6 @@ enum sci_status
 static enum sci_status stp_request_udma_await_tc_event(struct isci_request *ireq,
 						       u32 completion_code)
 {
-	enum sci_status status = SCI_SUCCESS;
-
 	switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) {
 	case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD):
 		ireq->scu_status = SCU_TASK_DONE_GOOD;
@@ -2148,7 +2146,7 @@ static enum sci_status stp_request_udma_await_tc_event(struct isci_request *ireq
 		break;
 	}
 
-	return status;
+	return SCI_SUCCESS;
 }
 
 static enum sci_status atapi_raw_completion(struct isci_request *ireq, u32 completion_code,
-- 
1.8.3.1


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

* Re: [PATCH] isci: style: remove the unneeded variable: "status".
  2020-12-30  7:04 [PATCH] isci: style: remove the unneeded variable: "status" YANG LI
@ 2021-01-15  4:08 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2021-01-15  4:08 UTC (permalink / raw)
  To: jejb, YANG LI
  Cc: Martin K . Petersen, intel-linux-scu, linux-kernel, linux-scsi,
	artur.paszkiewicz

On Wed, 30 Dec 2020 15:04:20 +0800, YANG LI wrote:

> The variable 'status' is being initialized with SCI_SUCCESS and never
> update later with a new value. The initialization is redundant and can
> be removed.

Applied to 5.12/scsi-queue, thanks!

[1/1] isci: style: remove the unneeded variable: "status".
      https://git.kernel.org/mkp/scsi/c/dc0bfdb563c8

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2021-01-15  4:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-30  7:04 [PATCH] isci: style: remove the unneeded variable: "status" YANG LI
2021-01-15  4:08 ` 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;
as well as URLs for NNTP newsgroup(s).