diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index b2686dba05ece..37958ff57f707 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -214,6 +214,11 @@ static void sym_calc_visibility(struct symbol *sym) struct property *prop; tristate tri; + if (sym->flags & SYMBOL_HIDDEN) { + sym->visible = yes; + return; + } + /* any prompt visible? */ tri = no; for_all_prompts(sym, prop) { @@ -408,7 +413,6 @@ void sym_calc_value(struct symbol *sym) struct symbol_value newval, oldval; struct property *prop; struct menu *choice_menu; - bool usable; if (!sym) return; @@ -448,13 +452,6 @@ void sym_calc_value(struct symbol *sym) if (sym->visible != no) sym->flags |= SYMBOL_WRITE; - /* - * For a symbol to be processed during configuration it needs to - * be either visible or a transitional symbol that is hidden from - * menus and omitted from newly written .config files. - */ - usable = (sym->visible != no || (sym->flags & SYMBOL_HIDDEN)); - /* set default if recursively called */ sym->curr = newval; @@ -467,15 +464,13 @@ void sym_calc_value(struct symbol *sym) sym_calc_choice(choice_menu); newval.tri = sym->curr.tri; } else { - if (usable) { + if (sym->visible != no) { /* if the symbol is visible use the user value * if available, otherwise try the default value */ if (sym_has_value(sym)) { - tristate value = (sym->flags & SYMBOL_HIDDEN) ? - sym->def[S_DEF_USER].tri : sym->visible; newval.tri = EXPR_AND(sym->def[S_DEF_USER].tri, - value); + sym->visible); goto calc_newval; } } @@ -507,7 +502,7 @@ void sym_calc_value(struct symbol *sym) case S_STRING: case S_HEX: case S_INT: - if (usable && sym_has_value(sym)) { + if (sym->visible != no && sym_has_value(sym)) { newval.val = sym->def[S_DEF_USER].val; break; } @@ -536,7 +531,7 @@ void sym_calc_value(struct symbol *sym) } } - if (sym_is_choice(sym)) + if (sym_is_choice(sym) || sym->flags & SYMBOL_HIDDEN) sym->flags &= ~SYMBOL_WRITE; }