* [PATCH] firmware: qcom_scm: Prefer initialisation during the descriptor declaration
@ 2020-05-14 6:40 Amit Kucheria
2020-05-14 16:40 ` Bjorn Andersson
0 siblings, 1 reply; 2+ messages in thread
From: Amit Kucheria @ 2020-05-14 6:40 UTC (permalink / raw)
To: linux-kernel, linux-arm-msm, bjorn.andersson, Andy Gross, Elliot Berman
qcom_scm_iommu_secure_ptbl_init() initialises the args twice, once while
declaring the struct, and then again by assignment. Remove the duplicate
assignment.
Similarly, move arginfo initialisation to the declaration in
__qcom_scm_is_call_available for consistency with other .arginfo
initialisation in the file.
Fixes: 9a434cee773a ("firmware: qcom_scm: Dynamically support SMCCC and legacy conventions")
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
---
drivers/firmware/qcom_scm.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c
index 6ba132be1b6e..eae9c28679cc 100644
--- a/drivers/firmware/qcom_scm.c
+++ b/drivers/firmware/qcom_scm.c
@@ -228,10 +228,10 @@ static int __qcom_scm_is_call_available(struct device *dev, u32 svc_id,
.svc = QCOM_SCM_SVC_INFO,
.cmd = QCOM_SCM_INFO_IS_CALL_AVAIL,
.owner = ARM_SMCCC_OWNER_SIP,
+ .arginfo = QCOM_SCM_ARGS(1),
};
struct qcom_scm_res res;
- desc.arginfo = QCOM_SCM_ARGS(1);
switch (__get_convention()) {
case SMC_CONVENTION_ARM_32:
case SMC_CONVENTION_ARM_64:
@@ -742,12 +742,6 @@ int qcom_scm_iommu_secure_ptbl_init(u64 addr, u32 size, u32 spare)
};
int ret;
- desc.args[0] = addr;
- desc.args[1] = size;
- desc.args[2] = spare;
- desc.arginfo = QCOM_SCM_ARGS(3, QCOM_SCM_RW, QCOM_SCM_VAL,
- QCOM_SCM_VAL);
-
ret = qcom_scm_call(__scm->dev, &desc, NULL);
/* the pg table has been initialized already, ignore the error */
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] firmware: qcom_scm: Prefer initialisation during the descriptor declaration
2020-05-14 6:40 [PATCH] firmware: qcom_scm: Prefer initialisation during the descriptor declaration Amit Kucheria
@ 2020-05-14 16:40 ` Bjorn Andersson
0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2020-05-14 16:40 UTC (permalink / raw)
To: Amit Kucheria; +Cc: linux-kernel, linux-arm-msm, Andy Gross, Elliot Berman
On Wed 13 May 23:40 PDT 2020, Amit Kucheria wrote:
> qcom_scm_iommu_secure_ptbl_init() initialises the args twice, once while
> declaring the struct, and then again by assignment. Remove the duplicate
> assignment.
>
Seems like a leftover from the refactoring, thanks for spotting this.
> Similarly, move arginfo initialisation to the declaration in
> __qcom_scm_is_call_available for consistency with other .arginfo
> initialisation in the file.
>
Looks better.
> Fixes: 9a434cee773a ("firmware: qcom_scm: Dynamically support SMCCC and legacy conventions")
> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Regards,
Bjorn
> ---
> drivers/firmware/qcom_scm.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c
> index 6ba132be1b6e..eae9c28679cc 100644
> --- a/drivers/firmware/qcom_scm.c
> +++ b/drivers/firmware/qcom_scm.c
> @@ -228,10 +228,10 @@ static int __qcom_scm_is_call_available(struct device *dev, u32 svc_id,
> .svc = QCOM_SCM_SVC_INFO,
> .cmd = QCOM_SCM_INFO_IS_CALL_AVAIL,
> .owner = ARM_SMCCC_OWNER_SIP,
> + .arginfo = QCOM_SCM_ARGS(1),
> };
> struct qcom_scm_res res;
>
> - desc.arginfo = QCOM_SCM_ARGS(1);
> switch (__get_convention()) {
> case SMC_CONVENTION_ARM_32:
> case SMC_CONVENTION_ARM_64:
> @@ -742,12 +742,6 @@ int qcom_scm_iommu_secure_ptbl_init(u64 addr, u32 size, u32 spare)
> };
> int ret;
>
> - desc.args[0] = addr;
> - desc.args[1] = size;
> - desc.args[2] = spare;
> - desc.arginfo = QCOM_SCM_ARGS(3, QCOM_SCM_RW, QCOM_SCM_VAL,
> - QCOM_SCM_VAL);
> -
> ret = qcom_scm_call(__scm->dev, &desc, NULL);
>
> /* the pg table has been initialized already, ignore the error */
> --
> 2.20.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-14 16:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-14 6:40 [PATCH] firmware: qcom_scm: Prefer initialisation during the descriptor declaration Amit Kucheria
2020-05-14 16:40 ` Bjorn Andersson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.