Re: [PATCH 2/2] cpufreq: sun50i: replace of_node_put() with automatic cleanup handler
From: Markus Elfring
Date: Mon May 20 2024 - 05:29:16 EST
…
> > > +++ 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@xxxxxxxxxxxxx/
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