Skip to content

Commit

Permalink
of: overlay: Make node skipping in init_overlay_changeset() clearer
Browse files Browse the repository at this point in the history
Make it more clear that nodes without "__overlay__" subnodes are
skipped, by reverting the logic and using continue.
This also reduces indentation level.

Signed-off-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Rob Herring <[email protected]>
  • Loading branch information
geertu authored and robherring committed Dec 8, 2017
1 parent 35e691e commit 589b754
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions drivers/of/overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,18 +573,19 @@ static int init_overlay_changeset(struct overlay_changeset *ovcs,
cnt = 0;
for_each_child_of_node(tree, node) {
overlay_node = of_get_child_by_name(node, "__overlay__");
if (overlay_node) {
fragment = &fragments[cnt];
fragment->overlay = overlay_node;
fragment->target = find_target_node(node);
if (!fragment->target) {
of_node_put(fragment->overlay);
ret = -EINVAL;
goto err_free_fragments;
}
if (!overlay_node)
continue;

cnt++;
fragment = &fragments[cnt];
fragment->overlay = overlay_node;
fragment->target = find_target_node(node);
if (!fragment->target) {
of_node_put(fragment->overlay);
ret = -EINVAL;
goto err_free_fragments;
}

cnt++;
}

/*
Expand Down

0 comments on commit 589b754

Please sign in to comment.