From: Jan Beulich Date: Thu, 9 Dec 2010 08:11:38 +0000 (+0000) Subject: kconfig: fix undesirable side effect of adding "visible" menu attribute X-Git-Url: https://git.karo-electronics.de/?p=mv-sheeva.git;a=commitdiff_plain;h=7ad1227818f09242cfe9bf1845fd24211f5f99bd kconfig: fix undesirable side effect of adding "visible" menu attribute This lead to non-selected, non-user-selectable options to be written out to .config. This is not only pointless, but also preventing the user to be prompted should any of those options eventually become visible (e.g. by de-selecting the *_AUTO options the "visible" attribute was added for. Furthermore it is quite logical for the "visible" attribute of a menu to control the visibility of all contained prompts, which is what the patch does. Signed-off-by: Jan Beulich Signed-off-by: Michal Marek --- diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index b9d9aa18e6d..5f77dcb8977 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -140,6 +140,20 @@ struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *e } if (current_entry->prompt && current_entry != &rootmenu) prop_warn(prop, "prompt redefined"); + + /* Apply all upper menus' visibilities to actual prompts. */ + if(type == P_PROMPT) { + struct menu *menu = current_entry; + + while ((menu = menu->parent) != NULL) { + if (!menu->visibility) + continue; + prop->visible.expr + = expr_alloc_and(prop->visible.expr, + menu->visibility); + } + } + current_entry->prompt = prop; } prop->text = prompt;