linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Timo Alho <talho@nvidia.com>,
	linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] firmware: tegra: bpmp: use scoped device node handling to simplify error paths
Date: Tue, 1 Oct 2024 22:34:23 +0200	[thread overview]
Message-ID: <c15b73f1-6045-499e-8b4d-6cf8140e7de0@linaro.org> (raw)
In-Reply-To: <20240816135722.105945-2-krzysztof.kozlowski@linaro.org>

On 16/08/2024 15:57, Krzysztof Kozlowski wrote:
> Obtain the device node reference with scoped/cleanup.h to reduce error
> handling and make the code a bit simpler.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  drivers/firmware/tegra/bpmp.c | 16 ++++++----------
>  1 file changed, 6 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/firmware/tegra/bpmp.c b/drivers/firmware/tegra/bpmp.c
> index c3a1dc344961..2edc3838538e 100644
> --- a/drivers/firmware/tegra/bpmp.c
> +++ b/drivers/firmware/tegra/bpmp.c
> @@ -3,6 +3,7 @@
>   * Copyright (c) 2016, NVIDIA CORPORATION.  All rights reserved.
>   */
>  
> +#include <linux/cleanup.h>
>  #include <linux/clk/tegra.h>
>  #include <linux/genalloc.h>
>  #include <linux/mailbox_client.h>
> @@ -36,27 +37,22 @@ struct tegra_bpmp *tegra_bpmp_get(struct device *dev)
>  {
>  	struct platform_device *pdev;
>  	struct tegra_bpmp *bpmp;
> -	struct device_node *np;
>  
> -	np = of_parse_phandle(dev->of_node, "nvidia,bpmp", 0);
> +	struct device_node *np __free(device_node) = of_parse_phandle(dev->of_node,
> +								      "nvidia,bpmp", 0);

Uhhh, this is very strange.

Above is correct code which I sent.

But look what was applied:

 struct tegra_bpmp *tegra_bpmp_get(struct device *dev)
 {
+       struct device_node *np __free(device_node);

That's very different.

See commit 8812b8689ee6 ("firmware: tegra: bpmp: Use scoped device node
handling to simplify error paths").

Commit msg does not explain at all why my code was changed. It is not
only a courtesy but also requirement to mark changes done to commits
when applying.

Shall I assume more of my patches were silently changed when applied,
including adding questionable code there?


Best regards,
Krzysztof


  reply	other threads:[~2024-10-01 20:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-16 13:57 [PATCH 1/2] firmware: tegra: bpmp: drop unused mbox_client_to_bpmp() Krzysztof Kozlowski
2024-08-16 13:57 ` [PATCH 2/2] firmware: tegra: bpmp: use scoped device node handling to simplify error paths Krzysztof Kozlowski
2024-10-01 20:34   ` Krzysztof Kozlowski [this message]
2024-08-27 13:57 ` [PATCH 1/2] firmware: tegra: bpmp: drop unused mbox_client_to_bpmp() Thierry Reding

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=c15b73f1-6045-499e-8b4d-6cf8140e7de0@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=talho@nvidia.com \
    --cc=thierry.reding@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).