[PATCH] of/pdt: fix section mismatch warning

Sam Ravnborg sam at ravnborg.org
Wed Dec 28 09:26:58 EST 2011


On Tue, Dec 27, 2011 at 05:13:07PM -0500, David Miller wrote:
> From: Sam Ravnborg <sam at ravnborg.org>
> Date: Tue, 27 Dec 2011 23:04:08 +0100
> 
> > prom_early_alloc() is annotated __init, and users of
> > kernel_tree_alloc() is also annotated __init.
> > So simply match the annoation of these to fix the warning.
> 
> Not exactly.
> 
> drivers/of/fdt.c:of_fdt_unflatten_tree() is not marked __init but does
> pass kernel_tree_alloc in as a callback to __unflatten_device_tree()

We have two implementations of kernel_tree_alloc() - one in fdt.c and
another in pdt.c.

$ grep kernel_tree_alloc *
fdt.c:static void *kernel_tree_alloc(u64 size, u64 align)
fdt.c:  __unflatten_device_tree(device_tree, mynodes, &kernel_tree_alloc);
pdt.c:static void * __init kernel_tree_alloc(u64 size, u64 align)
pdt.c:  of_alias_scan(kernel_tree_alloc);

The version in fdt.c is using kzalloc() whereas the version in pdt.c
uses prom_early_alloc().

And of_fdt_unflatten_tree() uses the version in fdt.c - so the patch is OK.

It is confusing that they have the same name - but I did nto fix that.
And I forgot about this detail when I wrote the changelog.
[The christmas vacation effect it seems]

	Sam


More information about the devicetree-discuss mailing list