From f76a5240e217c5ba4bc752e9f7705b7cb67997d7 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Wed, 27 Sep 2017 14:41:30 +0200 Subject: Hide non-tristate symbols in non-y tristate choices There's old ad-hoc code that does this in the C implementation, added in f5eaa32 (kconfig: tristate choices with mixed tristate and boolean values). Unless a tristate choice is in "y" mode, non-tristate symbols get visibility "n". There are currently no tristate choices with non-tristate symbols in the kernel, so this never triggered. Modify some self tests that weren't aware of this behavior, and add some new ones. Also remove an old pointless test. --- kconfiglib.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'kconfiglib.py') diff --git a/kconfiglib.py b/kconfiglib.py index cbb7e5e..f27e93a 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -3272,8 +3272,13 @@ def _get_visibility(sc): vis = sc._config._eval_max(vis, cond_expr) if isinstance(sc, Symbol) and sc._is_choice_sym: - if sc._type == TRISTATE and vis == "m" and \ - sc._parent.get_mode() == "y": + if sc._parent._type == TRISTATE and sc._type != TRISTATE and \ + sc._parent.get_mode() != "y": + # Non-tristate choice symbols in tristate choices depend on the + # choice being in mode "y" + vis = "n" + elif sc._type == TRISTATE and vis == "m" and \ + sc._parent.get_mode() == "y": # Choice symbols with visibility "m" are not visible if the # choice has mode "y" vis = "n" -- cgit v1.2.3