aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-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);