From 5d09598d488f081e3be23f885ed65cbbe2d073b5 Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Mon, 23 Jan 2012 17:29:05 -0500 Subject: kconfig: fix new choices being skipped upon config update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Running `oldconfig' after any of the following configuration change: either trivial addition, such as: config A bool "A" choice prompt "Choice ?" depends on A config CHOICE_B bool "Choice B" config CHOICE_C bool "Choice C" endchoice or more tricky change: OLD KCONFIG | NEW KCONFIG | | config A | bool "A" | choice | choice prompt "Choice ?" | prompt "Choice ?" | config CHOICE_C | config CHOICE_C bool "Choice C" | bool "Choice C" | config CHOICE_D | config CHOICE_D bool "Choice D" | bool "Choice D" endchoice | | config CHOICE_E | bool "Choice E" | depends on A | endchoice will not cause the choice to be considered as NEW, and thus not be asked. The cause of this behavior is that choice's novelty are computed statically right after the saved configuration has been read. At this point, the new dependency's value is still unknown and asserted to be `no'. Moreover, no update to this decision is made afterward. Correct this by dynamically evaluating a choice's novelty, and removing the static evaluation. Reported-and-tested-by: Uwe Kleine-König Signed-off-by: Arnaud Lacombe Signed-off-by: Michal Marek --- scripts/kconfig/symbol.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'scripts/kconfig/symbol.c') diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 071f00c3046e..22a3c400fc41 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -262,11 +262,18 @@ static struct symbol *sym_calc_choice(struct symbol *sym) struct symbol *def_sym; struct property *prop; struct expr *e; + int flags; /* first calculate all choice values' visibilities */ + flags = sym->flags; prop = sym_get_choice_prop(sym); - expr_list_for_each_sym(prop->expr, e, def_sym) + expr_list_for_each_sym(prop->expr, e, def_sym) { sym_calc_visibility(def_sym); + if (def_sym->visible != no) + flags &= def_sym->flags; + } + + sym->flags &= flags | ~SYMBOL_DEF_USER; /* is the user choice visible? */ def_sym = sym->def[S_DEF_USER].val; -- cgit v1.2.3-59-g8ed1b