[PATCH] fdt_support: fix fdt_copy_fixed_partitions function()

Dragan Simic dsimic at manjaro.org
Mon Mar 11 13:02:13 CET 2024


On 2024-03-11 12:37, Dan Carpenter wrote:
> On Fri, Mar 08, 2024 at 02:34:04PM +0100, Patrice Chotard wrote:
>> Move variable declaration at the beginning of the function.
> 
> The problem, presumably, is that when declarations are in the middle of
> a block then it triggers a GCC warning.  "declarations after code" or
> whatever...  The commit message is not really clear.

IIRC, there's at least one more such case of block-local variables in
the same source code file, so perhaps we should move those as well, if
the final decision is to move some of them.

> And when I built this file I don't get a warning.  Is there a specific
> config required to trigger the warning?
> 
> Btw, the Linux kernel recently silenced this warning because it doesn't
> work well with the cleanup.h code...  It will be interesting to see if
> people abandon this style guideline.
> 
> regards,
> dan carpenter
> 
>> Fixes: 163c5f60ebb4 ("fdt_support: add fdt_copy_fixed_partitions 
>> function")
>> 
>> Signed-off-by: Patrice Chotard <patrice.chotard at foss.st.com>
>> ---


More information about the U-Boot mailing list