Re: [PATCH v2 03/12] of: overlay: rename identifiers to more reflect what they do

From: Rob Herring
Date: Tue Oct 17 2017 - 10:39:05 EST


On Mon, Oct 16, 2017 at 8:17 PM, <frowand.list@xxxxxxxxx> wrote:
> From: Frank Rowand <frank.rowand@xxxxxxxx>
>
> This patch is aimed primarily at drivers/of/overlay.c, but those
> changes also have a small impact in a few other files.
>
> overlay.c is difficult to read and maintain. Improve readability:
> - Rename functions, types and variables to better reflect what
> they do and to be consistent with names in other places,
> such as the device tree overlay FDT (flattened device tree),
> and make the algorithms more clear
> - Use the same names consistently throughout the file
> - Update comments for name changes
> - Fix incorrect comments
>
> This patch is intended to not introduce any functional change.
>
> Signed-off-by: Frank Rowand <frank.rowand@xxxxxxxx>
> ---
> Documentation/devicetree/overlay-notes.txt | 12 +-
> drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c | 5 +-
> drivers/of/dynamic.c | 2 +-
> drivers/of/overlay.c | 506 ++++++++++++++-------------
> drivers/of/unittest.c | 20 +-
> include/linux/of.h | 12 +-
> 6 files changed, 294 insertions(+), 263 deletions(-)

Doesn't build:

../drivers/of/overlay.c:397:41: warning: âstruct of_overlay_infoâ
declared inside parameter list will not be visible outside of this
definition or declaration
struct device_node *info_node, struct of_overlay_info *ovinfo)
^~~~~~~~~~~~~~~
../drivers/of/overlay.c:396:40: warning: âstruct of_overlayâ declared
inside parameter list will not be visible outside of this definition
or declaration
static int of_fill_overlay_info(struct of_overlay *ov,
^~~~~~~~~~
../drivers/of/overlay.c: In function âof_fill_overlay_infoâ:
../drivers/of/overlay.c:399:8: error: dereferencing pointer to
incomplete type âstruct of_overlay_infoâ
ovinfo->overlay = of_get_child_by_name(info_node, "__overlay__");
^~
../drivers/of/overlay.c: In function âinit_overlay_changesetâ:
../drivers/of/overlay.c:450:30: error: passing argument 1 of
âof_fill_overlay_infoâ from incompatible pointer type
[-Werror=incompatible-pointer-types]
ret = of_fill_overlay_info(ovcs, node, &fragments[cnt]);
^~~~
../drivers/of/overlay.c:396:12: note: expected âstruct of_overlay *â
but argument is of type âstruct overlay_changeset *â
static int of_fill_overlay_info(struct of_overlay *ov,
^~~~~~~~~~~~~~~~~~~~
../drivers/of/overlay.c:450:42: error: passing argument 3 of
âof_fill_overlay_infoâ from incompatible pointer type
[-Werror=incompatible-pointer-types]
ret = of_fill_overlay_info(ovcs, node, &fragments[cnt]);
^
../drivers/of/overlay.c:396:12: note: expected âstruct of_overlay_info
*â but argument is of type âstruct fragment *â
static int of_fill_overlay_info(struct of_overlay *ov,
^~~~~~~~~~~~~~~~~~~~


I could have messed something up as every commit so far conflicts with
"of: overlay: fix memory leak related to duplicated property". Can you
rebase on to my dt/next branch too.

Rob