public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	 Mukesh Ojha <quic_mojha@quicinc.com>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	 Stephan Gerhold <stephan.gerhold@linaro.org>,
	 Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
	Kuldeep Singh <quic_kuldsing@quicinc.com>,
	 Elliot Berman <quic_eberman@quicinc.com>,
	Andrew Halaney <ahalaney@redhat.com>,
	 Avaneesh Kumar Dwivedi <quic_akdwived@quicinc.com>,
	Andy Gross <andy.gross@linaro.org>,
	 linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/6] firmware: qcom: scm: smc: Narrow 'mempool' variable scope
Date: Wed, 20 Nov 2024 12:06:43 +0100	[thread overview]
Message-ID: <CAMRc=Me1n0u5jMCgAi6yXPxEK2dBp4Nz55r378h+qBru4ZKzVQ@mail.gmail.com> (raw)
In-Reply-To: <20241119-qcom-scm-missing-barriers-and-all-sort-of-srap-v1-6-7056127007a7@linaro.org>

On Tue, Nov 19, 2024 at 7:38 PM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.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@linaro.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@linaro.org>

  reply	other threads:[~2024-11-20 11:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-19 18:33 [PATCH 0/6] firmware: qcom: scm: Fixes for concurrency Krzysztof Kozlowski
2024-11-19 18:33 ` [PATCH 1/6] firmware: qcom: scm: Fix missing read barrier in qcom_scm_is_available() Krzysztof Kozlowski
2024-11-20 10:51   ` Bartosz Golaszewski
2024-11-19 18:33 ` [PATCH 2/6] firmware: qcom: scm: Fix missing read barrier in qcom_scm_get_tzmem_pool() Krzysztof Kozlowski
2024-11-19 18:45   ` Krzysztof Kozlowski
2024-11-19 18:33 ` [PATCH 3/6] firmware: qcom: scm: Handle various probe ordering for qcom_scm_assign_mem() Krzysztof Kozlowski
2024-11-19 18:33 ` [PATCH RFC/RFT 4/6] firmware: qcom: scm: Cleanup global '__scm' on probe failures Krzysztof Kozlowski
2024-11-19 19:37   ` Krzysztof Kozlowski
2024-11-19 18:33 ` [PATCH 5/6] firmware: qcom: scm: smc: Handle missing SCM device Krzysztof Kozlowski
2024-11-19 18:33 ` [PATCH 6/6] firmware: qcom: scm: smc: Narrow 'mempool' variable scope Krzysztof Kozlowski
2024-11-20 11:06   ` Bartosz Golaszewski [this message]
2024-11-20 11:13 ` [PATCH 0/6] firmware: qcom: scm: Fixes for concurrency Dmitry Baryshkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMRc=Me1n0u5jMCgAi6yXPxEK2dBp4Nz55r378h+qBru4ZKzVQ@mail.gmail.com' \
    --to=brgl@bgdev.pl \
    --cc=ahalaney@redhat.com \
    --cc=andersson@kernel.org \
    --cc=andy.gross@linaro.org \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=konradybcio@kernel.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_akdwived@quicinc.com \
    --cc=quic_eberman@quicinc.com \
    --cc=quic_kuldsing@quicinc.com \
    --cc=quic_mojha@quicinc.com \
    --cc=stephan.gerhold@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox