Skip to content

Commit d01661e

Browse files
committed
kconfig: show sub-menu entries even if the prompt is hidden
Since commit f79dc03 ("kconfig: refactor choice value calculation"), when EXPERT is disabled, nothing within the "if INPUT" ... "endif" block in drivers/input/Kconfig is displayed. This issue affects all command-line interfaces and GUI frontends. The prompt for INPUT is hidden when EXPERT is disabled. Previously, menu_is_visible() returned true in this case; however, it now returns false, resulting in all sub-menu entries being skipped. Here is a simplified test case illustrating the issue: config A bool "A" if X default y config B bool "B" depends on A When X is disabled, A becomes unconfigurable and is forced to y. B should be displayed, as its dependency is met. This commit restores the necessary code, so menu_is_visible() functions as it did previously. Fixes: f79dc03 ("kconfig: refactor choice value calculation") Reported-by: Edmund Raile <edmund.raile@proton.me> Closes: https://lore.kernel.org/all/5fd0dfc7ff171aa74352e638c276069a5f2e888d.camel@proton.me/ Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent 2ad7126 commit d01661e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

scripts/kconfig/menu.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,7 @@ bool menu_is_empty(struct menu *menu)
533533

534534
bool menu_is_visible(struct menu *menu)
535535
{
536+
struct menu *child;
536537
struct symbol *sym;
537538
tristate visible;
538539

@@ -551,7 +552,17 @@ bool menu_is_visible(struct menu *menu)
551552
} else
552553
visible = menu->prompt->visible.tri = expr_calc_value(menu->prompt->visible.expr);
553554

554-
return visible != no;
555+
if (visible != no)
556+
return true;
557+
558+
if (!sym || sym_get_tristate_value(menu->sym) == no)
559+
return false;
560+
561+
for (child = menu->list; child; child = child->next)
562+
if (menu_is_visible(child))
563+
return true;
564+
565+
return false;
555566
}
556567

557568
const char *menu_get_prompt(const struct menu *menu)

0 commit comments

Comments
 (0)