aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/confdata.c
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2007-07-09 14:43:58 -0400
committerSam Ravnborg <sam@ravnborg.org>2007-07-17 08:24:55 -0400
commitd8982ba1f2a24f1db89d23e9f5224f932f8b04a0 (patch)
tree1533053725aea6bb2eff822c50f2212125a84631 /scripts/kconfig/confdata.c
parenta412c1723da5133843688078b6f1f069fa9c93f7 (diff)
kconfig: reset generated values only if Kconfig and .config agree.
Normally generated values (Kconfig entries without a prompt) are cleared as they are regenerated anyway and so they appear as new should they become visible and defaults work as expected (once a value is set defaults aren't used anymore). The detection whether a value is generated or not is only based on its visibility status, which can quickly change for a lot of symbols by just removing a single line from .config or adding a dependency to Kconfig as you noticed. The patch now suppresses this logic when .config and Kconfig aren't in sync and .config needs to be updated, so that you can remove now a random value from .config and oldconfig won't reask for many other values. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/kconfig/confdata.c')
-rw-r--r--scripts/kconfig/confdata.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 664fe29dacef..b2913e9da495 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -341,27 +341,42 @@ int conf_read(const char *name)
341 conf_unsaved++; 341 conf_unsaved++;
342 /* maybe print value in verbose mode... */ 342 /* maybe print value in verbose mode... */
343 sym_ok: 343 sym_ok:
344 if (!sym_is_choice(sym))
345 continue;
346 /* The choice symbol only has a set value (and thus is not new)
347 * if all its visible childs have values.
348 */
349 prop = sym_get_choice_prop(sym);
350 flags = sym->flags;
351 for (e = prop->expr; e; e = e->left.expr)
352 if (e->right.sym->visible != no)
353 flags &= e->right.sym->flags;
354 sym->flags &= flags | ~SYMBOL_DEF_USER;
355 }
356
357 for_all_symbols(i, sym) {
344 if (sym_has_value(sym) && !sym_is_choice_value(sym)) { 358 if (sym_has_value(sym) && !sym_is_choice_value(sym)) {
345 if (sym->visible == no) 359 /* Reset values of generates values, so they'll appear
360 * as new, if they should become visible, but that
361 * doesn't quite work if the Kconfig and the saved
362 * configuration disagree.
363 */
364 if (sym->visible == no && !conf_unsaved)
346 sym->flags &= ~SYMBOL_DEF_USER; 365 sym->flags &= ~SYMBOL_DEF_USER;
347 switch (sym->type) { 366 switch (sym->type) {
348 case S_STRING: 367 case S_STRING:
349 case S_INT: 368 case S_INT:
350 case S_HEX: 369 case S_HEX:
351 if (!sym_string_within_range(sym, sym->def[S_DEF_USER].val)) 370 /* Reset a string value if it's out of range */
352 sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER); 371 if (sym_string_within_range(sym, sym->def[S_DEF_USER].val))
372 break;
373 sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER);
374 conf_unsaved++;
375 break;
353 default: 376 default:
354 break; 377 break;
355 } 378 }
356 } 379 }
357 if (!sym_is_choice(sym))
358 continue;
359 prop = sym_get_choice_prop(sym);
360 flags = sym->flags;
361 for (e = prop->expr; e; e = e->left.expr)
362 if (e->right.sym->visible != no)
363 flags &= e->right.sym->flags;
364 sym->flags &= flags | ~SYMBOL_DEF_USER;
365 } 380 }
366 381
367 sym_add_change_count(conf_warnings || conf_unsaved); 382 sym_add_change_count(conf_warnings || conf_unsaved);