[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMRc=Me1n0u5jMCgAi6yXPxEK2dBp4Nz55r378h+qBru4ZKzVQ@mail.gmail.com>
Date: Wed, 20 Nov 2024 12:06:43 +0100
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc: Bjorn Andersson <andersson@...nel.org>, Konrad Dybcio <konradybcio@...nel.org>,
Mukesh Ojha <quic_mojha@...cinc.com>, Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
Stephan Gerhold <stephan.gerhold@...aro.org>,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>, Kuldeep Singh <quic_kuldsing@...cinc.com>,
Elliot Berman <quic_eberman@...cinc.com>, Andrew Halaney <ahalaney@...hat.com>,
Avaneesh Kumar Dwivedi <quic_akdwived@...cinc.com>, Andy Gross <andy.gross@...aro.org>,
linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 6/6] firmware: qcom: scm: smc: Narrow 'mempool' variable scope
On Tue, Nov 19, 2024 at 7:38 PM Krzysztof Kozlowski
<krzysztof.kozlowski@...aro.org> wrote:
>
> Only part of the __scm_smc_call() function uses 'mempool' variable, so
> narrow the scope to make it more readable.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
> ---
> drivers/firmware/qcom/qcom_scm-smc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/qcom/qcom_scm-smc.c b/drivers/firmware/qcom/qcom_scm-smc.c
> index 3f10b23ec941b558e1d91761011776bb5c9d11b5..574930729ddd72d98013770da97cc018a52554ff 100644
> --- a/drivers/firmware/qcom/qcom_scm-smc.c
> +++ b/drivers/firmware/qcom/qcom_scm-smc.c
> @@ -152,7 +152,6 @@ int __scm_smc_call(struct device *dev, const struct qcom_scm_desc *desc,
> enum qcom_scm_convention qcom_convention,
> struct qcom_scm_res *res, bool atomic)
> {
> - struct qcom_tzmem_pool *mempool = qcom_scm_get_tzmem_pool();
> int arglen = desc->arginfo & 0xf;
> int i, ret;
> void *args_virt __free(qcom_tzmem) = NULL;
> @@ -173,6 +172,8 @@ int __scm_smc_call(struct device *dev, const struct qcom_scm_desc *desc,
> smc.args[i + SCM_SMC_FIRST_REG_IDX] = desc->args[i];
>
> if (unlikely(arglen > SCM_SMC_N_REG_ARGS)) {
> + struct qcom_tzmem_pool *mempool = qcom_scm_get_tzmem_pool();
> +
> if (!mempool)
> return -EINVAL;
>
>
> --
> 2.43.0
>
>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Powered by blists - more mailing lists