Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Viresh Kumar <viresh.kumar@linaro.org>,
	Javier Carrasco <javier.carrasco.cruz@gmail.com>,
	linux-sunxi@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>,
	Andre Przywara <andre.przywara@arm.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Peter Zijlstra <peterz@infradead.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Samuel Holland <samuel@sholland.org>,
	Yangtao Li <tiny.windzz@gmail.com>
Subject: Re: [PATCH 2/2] cpufreq: sun50i: replace of_node_put() with automatic cleanup handler
Date: Mon, 20 May 2024 11:28:09 +0200	[thread overview]
Message-ID: <fb6ee370-54d7-4eff-8a44-ee7cf2d13e61@web.de> (raw)
In-Reply-To: <20240520083522.vvga3aqjg4w3adkj@vireshk-i7>

…
> > > +++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c
> > > @@ -131,14 +131,14 @@ static const struct of_device_id cpu_opp_match_list[] = {
> > >  static bool dt_has_supported_hw(void)
> > >  {
> > >  	bool has_opp_supported_hw = false;
> > > -	struct device_node *np;
> > >  	struct device *cpu_dev;
> > >
> > >  	cpu_dev = get_cpu_device(0);
> > >  	if (!cpu_dev)
> > >  		return false;
> > >
> > > -	np = dev_pm_opp_of_get_opp_desc_node(cpu_dev);
> > > +	struct device_node *np __free(device_node) =
> > > +		dev_pm_opp_of_get_opp_desc_node(cpu_dev);
>
> Won't that result in build warning, mixed code and definitions now ?

I suggest to take another look at a corresponding information source.

[PATCH v3 04/57] kbuild: Drop -Wdeclaration-after-statement
https://lore.kernel.org/all/20230612093537.693926033@infradead.org/

See also:
https://gcc.gnu.org/onlinedocs/gcc-13.2.0/gcc/Warning-Options.html#index-Wdeclaration-after-statement


Would you like to stress a scope reduction for the affected local variable
by adding any curly brackets?

Regards,
Markus

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-05-20  9:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03 17:52 [PATCH 0/2] cpufreq: sun50i: fix memory leak and remove of_node_put() Javier Carrasco
2024-05-03 17:52 ` [PATCH 1/2] cpufreq: sun50i: fix memory leak in dt_has_supported_hw() Javier Carrasco
2024-05-10 16:49   ` Andre Przywara
2024-05-20  7:33     ` Viresh Kumar
2024-05-20  8:26       ` Andre Przywara
2024-05-20  8:34         ` Viresh Kumar
2024-05-03 17:52 ` [PATCH 2/2] cpufreq: sun50i: replace of_node_put() with automatic cleanup handler Javier Carrasco
2024-05-10 17:42   ` Andre Przywara
2024-05-20  8:35     ` Viresh Kumar
2024-05-20  9:28       ` Markus Elfring [this message]
2024-05-20  9:31         ` Viresh Kumar
2024-05-20  9:32 ` [PATCH 0/2] cpufreq: sun50i: fix memory leak and remove of_node_put() Viresh Kumar

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=fb6ee370-54d7-4eff-8a44-ee7cf2d13e61@web.de \
    --to=markus.elfring@web.de \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=andre.przywara@arm.com \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=peterz@infradead.org \
    --cc=rafael@kernel.org \
    --cc=samuel@sholland.org \
    --cc=tiny.windzz@gmail.com \
    --cc=viresh.kumar@linaro.org \
    --cc=wens@csie.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