Commit 3f23ca2b authored by Roman Zippel's avatar Roman Zippel Committed by Linus Torvalds

[PATCH] kconfig: fix restart for choice symbols

The restart check whether new symbols became visible, didn't always work for
choice symbols.  Even if a choice symbol itself isn't changable, the childs
are.  This also requires to update the new status of all choice values, once
one of them is set.
Signed-off-by: default avatarRoman Zippel <zippel@linux-m68k.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3f04e7dd
...@@ -467,15 +467,14 @@ static void check_conf(struct menu *menu) ...@@ -467,15 +467,14 @@ static void check_conf(struct menu *menu)
return; return;
sym = menu->sym; sym = menu->sym;
if (sym) { if (sym && !sym_has_value(sym)) {
if (sym_is_changable(sym) && !sym_has_value(sym)) { if (sym_is_changable(sym) ||
(sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {
if (!conf_cnt++) if (!conf_cnt++)
printf(_("*\n* Restart config...\n*\n")); printf(_("*\n* Restart config...\n*\n"));
rootEntry = menu_get_parent_menu(menu); rootEntry = menu_get_parent_menu(menu);
conf(rootEntry); conf(rootEntry);
} }
if (sym_is_choice(sym) && sym_get_tristate_value(sym) != mod)
return;
} }
for (child = menu->list; child; child = child->next) for (child = menu->list; child; child = child->next)
......
...@@ -380,11 +380,22 @@ bool sym_set_tristate_value(struct symbol *sym, tristate val) ...@@ -380,11 +380,22 @@ bool sym_set_tristate_value(struct symbol *sym, tristate val)
sym->flags &= ~SYMBOL_NEW; sym->flags &= ~SYMBOL_NEW;
sym_set_changed(sym); sym_set_changed(sym);
} }
/*
* setting a choice value also resets the new flag of the choice
* symbol and all other choice values.
*/
if (sym_is_choice_value(sym) && val == yes) { if (sym_is_choice_value(sym) && val == yes) {
struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym)); struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym));
struct property *prop;
struct expr *e;
cs->user.val = sym; cs->user.val = sym;
cs->flags &= ~SYMBOL_NEW; cs->flags &= ~SYMBOL_NEW;
prop = sym_get_choice_prop(cs);
for (e = prop->expr; e; e = e->left.expr) {
if (e->right.sym->visible != no)
e->right.sym->flags &= ~SYMBOL_NEW;
}
} }
sym->user.tri = val; sym->user.tri = val;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment