mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
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 <grant.likely@arm.com>
Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
fe667e382b
commit
b260c4f610
3 changed files with 14 additions and 8 deletions
17
dtc-parser.y
17
dtc-parser.y
|
@ -166,7 +166,17 @@ devicetree:
|
|||
{
|
||||
$$ = merge_nodes($1, $3);
|
||||
}
|
||||
|
||||
| DT_REF nodedef
|
||||
{
|
||||
/*
|
||||
* We rely on the rule being always:
|
||||
* versioninfo plugindecl memreserves devicetree
|
||||
* so $-1 is what we want (plugindecl)
|
||||
*/
|
||||
if (!($<flags>-1 & DTSF_PLUGIN))
|
||||
ERROR(&@2, "Label or path %s not found", $1);
|
||||
$$ = add_orphan_node(name_node(build_node(NULL, NULL), ""), $2, $1);
|
||||
}
|
||||
| devicetree DT_LABEL DT_REF nodedef
|
||||
{
|
||||
struct node *target = get_node_by_ref($1, $3);
|
||||
|
@ -209,11 +219,6 @@ devicetree:
|
|||
|
||||
$$ = $1;
|
||||
}
|
||||
| /* empty */
|
||||
{
|
||||
/* build empty node */
|
||||
$$ = name_node(build_node(NULL, NULL), "");
|
||||
}
|
||||
;
|
||||
|
||||
nodedef:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue