Skip to content

Commit 915daad

Browse files
ukleinekdgibson
authored andcommitted
Start with empty __local_fixups__ and __fixups__ nodes
When the meta nodes __local_fixups__ and __fixups__ are generated, and one of these (or both) already exist, the information contained there is duplicated at best and stale otherwise. So remove the nodes before starting to fill them. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: David Gibson <[email protected]>
1 parent 4ea851f commit 915daad

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

livetree.c

+15-2
Original file line numberDiff line numberDiff line change
@@ -1056,16 +1056,29 @@ void generate_label_tree(struct dt_info *dti, const char *name, bool allocph)
10561056

10571057
void generate_fixups_tree(struct dt_info *dti, const char *name)
10581058
{
1059+
struct node *n = get_subnode(dti->dt, name);
1060+
1061+
/* Start with an empty __fixups__ node to not get duplicates */
1062+
if (n)
1063+
n->deleted = true;
1064+
10591065
if (!any_fixup_tree(dti, dti->dt))
10601066
return;
1061-
generate_fixups_tree_internal(dti, build_root_node(dti->dt, name),
1067+
generate_fixups_tree_internal(dti,
1068+
build_and_name_child_node(dti->dt, name),
10621069
dti->dt);
10631070
}
10641071

10651072
void generate_local_fixups_tree(struct dt_info *dti, const char *name)
10661073
{
1074+
struct node *n = get_subnode(dti->dt, name);
1075+
1076+
/* Start with an empty __local_fixups__ node to not get duplicates */
1077+
if (n)
1078+
n->deleted = true;
10671079
if (!any_local_fixup_tree(dti, dti->dt))
10681080
return;
1069-
generate_local_fixups_tree_internal(dti, build_root_node(dti->dt, name),
1081+
generate_local_fixups_tree_internal(dti,
1082+
build_and_name_child_node(dti->dt, name),
10701083
dti->dt);
10711084
}

0 commit comments

Comments
 (0)