From b260c4f610c004c6e9e36c5f7bbb58d23e605bf1 Mon Sep 17 00:00:00 2001 From: Grant Likely Date: Mon, 20 Nov 2017 17:12:18 +0000 Subject: Fix ambiguous grammar for devicetree rule Commit 737b2df3, "overlay: Add syntactic sugar version of overlays" introduced an empty rule for "devicetree" that created ambiguities in the grammar and causes the following warning: BISON dtc-parser.tab.c dtc-parser.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr] Fix the grammar by explicitly testing for the condition the new overlay grammar wants to use. This means duplicating a very small amount of grammar processing code, but the alternative seems to be a more invasive reorganization of the devicetree rule. Better to fix it this way now and save the reorg for a separate patch. Signed-off-by: Grant Likely Cc: Pantelis Antoniou Cc: David Gibson Signed-off-by: David Gibson --- livetree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'livetree.c') diff --git a/livetree.c b/livetree.c index 457d01e..57b7db2 100644 --- a/livetree.c +++ b/livetree.c @@ -216,7 +216,7 @@ struct node *merge_nodes(struct node *old_node, struct node *new_node) return old_node; } -void add_orphan_node(struct node *dt, struct node *new_node, char *ref) +struct node * add_orphan_node(struct node *dt, struct node *new_node, char *ref) { static unsigned int next_orphan_fragment = 0; struct node *node; @@ -236,6 +236,7 @@ void add_orphan_node(struct node *dt, struct node *new_node, char *ref) name_node(node, name); add_child(dt, node); + return dt; } struct node *chain_node(struct node *first, struct node *list) -- cgit v1.1