From 5c2a3458a51a78665adbebd3ce64d2ea0f95718d Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Fri, 10 Nov 2017 08:37:42 +0100 Subject: Simplify m->y visibility promotion Can use the magic .type attribute to check for modules being disabled. Also remove note about infinite recursion. Pretty sure anything that would cause infinite recursion here would be a proper circular dependency (like MODULES depending on m). --- kconfiglib.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'kconfiglib.py') diff --git a/kconfiglib.py b/kconfiglib.py index 1977047..07b9f81 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -3627,11 +3627,9 @@ def _get_visibility(sc): # Choice symbols with m visibility are not visible in y mode return 0 - # Promote m to y if we're dealing with a non-tristate. This might lead to - # infinite recursion if something really weird is done with MODULES, but - # it's not a problem in practice. - if vis == 1 and \ - (sc.orig_type != TRISTATE or not sc.kconfig.modules.tri_value): + # Promote m to y if we're dealing with a non-tristate (possibly due to + # modules being disabled) + if vis == 1 and sc.type != TRISTATE: return 2 return vis -- cgit v1.2.3