* [PATCH] scsi: isci: Remove redundant check in isci_task_request_build()
@ 2023-11-28 12:11 Artem Chernyshev
2023-12-06 2:13 ` Martin K. Petersen
2023-12-14 4:29 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Artem Chernyshev @ 2023-11-28 12:11 UTC (permalink / raw)
To: Artur Paszkiewicz
Cc: Artem Chernyshev, James E . J . Bottomley, Martin K . Petersen,
linux-scsi, linux-kernel, lvc-project
sci_task_request_construct_ssp() have invariant return. Change
this function to void and get rid of unnecessary checks.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
---
drivers/scsi/isci/request.c | 5 +----
drivers/scsi/isci/request.h | 2 +-
drivers/scsi/isci/task.c | 4 +---
3 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c
index a7b3243b471d..71f711cb0628 100644
--- a/drivers/scsi/isci/request.c
+++ b/drivers/scsi/isci/request.c
@@ -738,8 +738,7 @@ static enum sci_status sci_io_request_construct_basic_ssp(struct isci_request *i
return SCI_SUCCESS;
}
-enum sci_status sci_task_request_construct_ssp(
- struct isci_request *ireq)
+void sci_task_request_construct_ssp(struct isci_request *ireq)
{
/* Construct the SSP Task SCU Task Context */
scu_ssp_task_request_construct_task_context(ireq);
@@ -748,8 +747,6 @@ enum sci_status sci_task_request_construct_ssp(
sci_task_request_build_ssp_task_iu(ireq);
sci_change_state(&ireq->sm, SCI_REQ_CONSTRUCTED);
-
- return SCI_SUCCESS;
}
static enum sci_status sci_io_request_construct_basic_sata(struct isci_request *ireq)
diff --git a/drivers/scsi/isci/request.h b/drivers/scsi/isci/request.h
index 20b141739e4d..79ddfffbf73c 100644
--- a/drivers/scsi/isci/request.h
+++ b/drivers/scsi/isci/request.h
@@ -300,7 +300,7 @@ sci_task_request_construct(struct isci_host *ihost,
struct isci_remote_device *idev,
u16 io_tag,
struct isci_request *ireq);
-enum sci_status sci_task_request_construct_ssp(struct isci_request *ireq);
+void sci_task_request_construct_ssp(struct isci_request *ireq);
void sci_smp_request_copy_response(struct isci_request *ireq);
static inline int isci_task_is_ncq_recovery(struct sas_task *task)
diff --git a/drivers/scsi/isci/task.c b/drivers/scsi/isci/task.c
index c514b20293b2..3a25b1a2c52d 100644
--- a/drivers/scsi/isci/task.c
+++ b/drivers/scsi/isci/task.c
@@ -243,9 +243,7 @@ static struct isci_request *isci_task_request_build(struct isci_host *ihost,
/* XXX convert to get this from task->tproto like other drivers */
if (dev->dev_type == SAS_END_DEVICE) {
isci_tmf->proto = SAS_PROTOCOL_SSP;
- status = sci_task_request_construct_ssp(ireq);
- if (status != SCI_SUCCESS)
- return NULL;
+ sci_task_request_construct_ssp(ireq);
}
return ireq;
--
2.37.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: isci: Remove redundant check in isci_task_request_build()
2023-11-28 12:11 [PATCH] scsi: isci: Remove redundant check in isci_task_request_build() Artem Chernyshev
@ 2023-12-06 2:13 ` Martin K. Petersen
2023-12-14 4:29 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2023-12-06 2:13 UTC (permalink / raw)
To: Artem Chernyshev
Cc: Artur Paszkiewicz, James E . J . Bottomley, Martin K . Petersen,
linux-scsi, linux-kernel, lvc-project
Artem,
> sci_task_request_construct_ssp() have invariant return. Change this
> function to void and get rid of unnecessary checks.
Applied to 6.8/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: isci: Remove redundant check in isci_task_request_build()
2023-11-28 12:11 [PATCH] scsi: isci: Remove redundant check in isci_task_request_build() Artem Chernyshev
2023-12-06 2:13 ` Martin K. Petersen
@ 2023-12-14 4:29 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2023-12-14 4:29 UTC (permalink / raw)
To: Artur Paszkiewicz, Artem Chernyshev
Cc: Martin K . Petersen, James E . J . Bottomley, linux-scsi,
linux-kernel, lvc-project
On Tue, 28 Nov 2023 15:11:59 +0300, Artem Chernyshev wrote:
> sci_task_request_construct_ssp() have invariant return. Change
> this function to void and get rid of unnecessary checks.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
>
Applied to 6.8/scsi-queue, thanks!
[1/1] scsi: isci: Remove redundant check in isci_task_request_build()
https://git.kernel.org/mkp/scsi/c/25cba909ade2
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-12-14 4:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-28 12:11 [PATCH] scsi: isci: Remove redundant check in isci_task_request_build() Artem Chernyshev
2023-12-06 2:13 ` Martin K. Petersen
2023-12-14 4:29 ` 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