Skip to content

Commit 8fc44f2

Browse files
ulfalizercarlescufi
authored andcommitted
kconfiglib: Update to e8408a06c68d8
Update Kconfiglib to upstream revision e8408a06c68d8 (+ local Zephyr modifications) to get commit e8408a06c68d8 ("Move sanity checking to after _finalize_tree()") in. It fixes some obscure false-positive warnings for named choices that came up in #6948. Origin: https://github.com/zephyrproject-rtos/Kconfiglib/tree/zephyr Signed-off-by: Ulf Magnusson <[email protected]>
1 parent bf44bac commit 8fc44f2

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

scripts/kconfig/kconfiglib.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ def __init__(self, filename="Kconfig", warn=True):
589589
self.const_syms = {}
590590
self.defined_syms = []
591591
self.named_choices = {}
592-
# Used for quickly invalidating all choices
592+
# List containing all choices. Not sure it's helpful to expose this.
593593
self._choices = []
594594

595595
for nmy in "n", "m", "y":
@@ -669,6 +669,17 @@ def __init__(self, filename="Kconfig", warn=True):
669669
# Do various post-processing of the menu tree
670670
_finalize_tree(self.top_node)
671671

672+
673+
# Do sanity checks. Some of these depend on everything being
674+
# finalized.
675+
676+
for sym in self.defined_syms:
677+
_check_sym_sanity(sym)
678+
679+
for choice in self._choices:
680+
_check_choice_sanity(choice)
681+
682+
672683
# Build Symbol._dependents for all symbols
673684
self._build_dep()
674685

@@ -4540,8 +4551,6 @@ def _finalize_tree(node):
45404551
node.next = cur.next
45414552
cur.next = None
45424553

4543-
_check_sym_sanity(node.item)
4544-
45454554

45464555
if node.list:
45474556
# We have a node with child nodes where the child nodes are now
@@ -4553,7 +4562,6 @@ def _finalize_tree(node):
45534562
# Empty choices (node.list None) are possible, so this needs to go outside
45544563
if isinstance(node.item, Choice):
45554564
_finalize_choice(node)
4556-
_check_choice_sanity(node.item)
45574565

45584566
def _check_sym_sanity(sym):
45594567
# Checks various symbol properties that are handiest to check after

0 commit comments

Comments
 (0)