aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2005-11-09 00:34:48 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-09 10:55:53 -0500
commit3f23ca2b37d13a89bb6cd0421821fc9c3b8ccd47 (patch)
tree134efbc253baa6aef5c2a39ffc4c5ab66dba7902
parent3f04e7ddf47a1c821dfaa886161d94774af583fa (diff)
[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: Roman Zippel <zippel@linux-m68k.org> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--scripts/kconfig/conf.c7
-rw-r--r--scripts/kconfig/symbol.c11
2 files changed, 14 insertions, 4 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index bc20cab9d0d6..dffbf2ea1f9d 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -467,15 +467,14 @@ static void check_conf(struct menu *menu)
467 return; 467 return;
468 468
469 sym = menu->sym; 469 sym = menu->sym;
470 if (sym) { 470 if (sym && !sym_has_value(sym)) {
471 if (sym_is_changable(sym) && !sym_has_value(sym)) { 471 if (sym_is_changable(sym) ||
472 (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {
472 if (!conf_cnt++) 473 if (!conf_cnt++)
473 printf(_("*\n* Restart config...\n*\n")); 474 printf(_("*\n* Restart config...\n*\n"));
474 rootEntry = menu_get_parent_menu(menu); 475 rootEntry = menu_get_parent_menu(menu);
475 conf(rootEntry); 476 conf(rootEntry);
476 } 477 }
477 if (sym_is_choice(sym) && sym_get_tristate_value(sym) != mod)
478 return;
479 } 478 }
480 479
481 for (child = menu->list; child; child = child->next) 480 for (child = menu->list; child; child = child->next)
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 10d96c4188dd..29bff43adc5e 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -380,11 +380,22 @@ bool sym_set_tristate_value(struct symbol *sym, tristate val)
380 sym->flags &= ~SYMBOL_NEW; 380 sym->flags &= ~SYMBOL_NEW;
381 sym_set_changed(sym); 381 sym_set_changed(sym);
382 } 382 }
383 /*
384 * setting a choice value also resets the new flag of the choice
385 * symbol and all other choice values.
386 */
383 if (sym_is_choice_value(sym) && val == yes) { 387 if (sym_is_choice_value(sym) && val == yes) {
384 struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym)); 388 struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym));
389 struct property *prop;
390 struct expr *e;
385 391
386 cs->user.val = sym; 392 cs->user.val = sym;
387 cs->flags &= ~SYMBOL_NEW; 393 cs->flags &= ~SYMBOL_NEW;
394 prop = sym_get_choice_prop(cs);
395 for (e = prop->expr; e; e = e->left.expr) {
396 if (e->right.sym->visible != no)
397 e->right.sym->flags &= ~SYMBOL_NEW;
398 }
388 } 399 }
389 400
390 sym->user.tri = val; 401 sym->user.tri = val;