public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Kathiravan Thirumoorthy
	<kathiravan.thirumoorthy@oss.qualcomm.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] firmware: qcom: scm: Use __cleanup() for device_node pointers
Date: Tue, 18 Nov 2025 12:38:26 +0100	[thread overview]
Message-ID: <86c6bb52-921e-4644-82fe-474f63fc565e@kernel.org> (raw)
In-Reply-To: <20251117-scm_cleanup_of_node_put-v1-1-307d36d6b849@oss.qualcomm.com>

On 17/11/2025 17:22, Kathiravan Thirumoorthy wrote:
> Make use of the __cleanup() attribute for device_node pointers to simplify
> resource management and remove explicit of_node_put() calls.
> 
> Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
> ---
>  drivers/firmware/qcom/qcom_scm.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c
> index e777b7cb9b127944fe112f453cae9cbc40c06cae..7c1fffa8e7ad48b294b90e7e63f726d0ba7d55e1 100644
> --- a/drivers/firmware/qcom/qcom_scm.c
> +++ b/drivers/firmware/qcom/qcom_scm.c
> @@ -1746,7 +1746,7 @@ EXPORT_SYMBOL_GPL(qcom_scm_gpu_init_regs);
>  
>  static int qcom_scm_find_dload_address(struct device *dev, u64 *addr)
>  {
> -	struct device_node *tcsr;
> +	struct device_node *tcsr __free(device_node) = NULL;


NAK.

This is wrong syntax. This must come with constructor.

Don't use cleanup.h if you do not understand its syntax. You just lead
to worse code and encourage bugs.

Best regards,
Krzysztof

      parent reply	other threads:[~2025-11-18 11:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-17 16:22 [PATCH] firmware: qcom: scm: Use __cleanup() for device_node pointers Kathiravan Thirumoorthy
2025-11-17 17:04 ` Dmitry Baryshkov
2025-11-18 11:38 ` Krzysztof Kozlowski [this message]

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=86c6bb52-921e-4644-82fe-474f63fc565e@kernel.org \
    --to=krzk@kernel.org \
    --cc=andersson@kernel.org \
    --cc=kathiravan.thirumoorthy@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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