From: Stephen Boyd <sboyd@kernel.org>
To: David Hunter <david.hunter.linux@gmail.com>
Cc: david.hunter.linux@gmail.com, javier.carrasco.cruz@gmail.com,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
mturquette@baylibre.com, shuah@kernel.org
Subject: Re: [PATCH 1/1 V2] Driver: clk-qoriq.c: replace of_node_put with _free improves cleanup
Date: Tue, 27 Aug 2024 17:03:17 -0700 [thread overview]
Message-ID: <66c0550553cb5d9d332d48d9fb80d4f9.sboyd@kernel.org> (raw)
In-Reply-To: <20240821010739.15293-1-david.hunter.linux@gmail.com>
The subject should be
clk: clk-qoriq: Replace of_node_put() with __free()
Quoting David Hunter (2024-08-20 18:07:39)
> Use _free() to have automatic cleanup instead of calling of_node_put()
__free()
> manually.
>
> Compiled without errors or warnings.
>
> Signed-off-by: David Hunter <david.hunter.linux@gmail.com>
> ---
> The following commit has information on _free(device_node):
> 9448e55d032d99af8e23487f51a542d51b2f1a48
>
> V1 --> V2
> - Improved message body
> - Use change log to give more information about _free()
Please don't send the next version as a reply to the previous patch.
> ---
> drivers/clk/clk-qoriq.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
> index 4dcde305944c..941a0372db4b 100644
> --- a/drivers/clk/clk-qoriq.c
> +++ b/drivers/clk/clk-qoriq.c
> @@ -1065,11 +1065,8 @@ static void __init _clockgen_init(struct device_node *np, bool legacy);
> static void __init legacy_init_clockgen(struct device_node *np)
> {
> if (!clockgen.node) {
> - struct device_node *parent_np;
> -
> - parent_np = of_get_parent(np);
> + struct device_node __free(device_node) *parent_np = of_get_parent(np);
It seems the __free() comes after the variable name declaration if my
grep skills are working today.
Also, please include linux/cleanup.h at the top of the file for __free().
> _clockgen_init(parent_np, true);
> - of_node_put(parent_np);
> }
> }
prev parent reply other threads:[~2024-08-28 0:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-20 1:35 [PATCH 1/1] " David Hunter
2024-08-20 22:03 ` Stephen Boyd
2024-08-21 1:07 ` [PATCH 1/1 V2] " David Hunter
2024-08-28 0:03 ` Stephen Boyd [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=66c0550553cb5d9d332d48d9fb80d4f9.sboyd@kernel.org \
--to=sboyd@kernel.org \
--cc=david.hunter.linux@gmail.com \
--cc=javier.carrasco.cruz@gmail.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=shuah@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
all inboxes | Powered by JetHome®