aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
authorJan Beulich <JBeulich@novell.com>2010-06-30 08:11:01 -0400
committerMichal Marek <mmarek@suse.cz>2010-07-08 08:38:14 -0400
commit0a28c47b8db8ff74d1bfbc5c5ad0100cea472351 (patch)
tree403f1aa1877d6cf74138dd7643387df65ae9220b /scripts/kconfig
parent246cf9c26bf11f2bffbecea6e5bd222eee7b1df8 (diff)
kconfig: Don't write invisible choice values
This makes it so "make oldconfig" really prompts for any choice where options that previously weren't visible just became so. Previously one would have to remember to go over all choice values and check whether some that previously couldn't be selected now can be. Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/symbol.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 174b230a52b0..c127fa342f1d 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -232,13 +232,15 @@ static struct symbol *sym_calc_choice(struct symbol *sym)
232 struct property *prop; 232 struct property *prop;
233 struct expr *e; 233 struct expr *e;
234 234
235 /* first calculate all choice values' visibilities */
236 prop = sym_get_choice_prop(sym);
237 expr_list_for_each_sym(prop->expr, e, def_sym)
238 sym_calc_visibility(def_sym);
239
235 /* is the user choice visible? */ 240 /* is the user choice visible? */
236 def_sym = sym->def[S_DEF_USER].val; 241 def_sym = sym->def[S_DEF_USER].val;
237 if (def_sym) { 242 if (def_sym && def_sym->visible != no)
238 sym_calc_visibility(def_sym); 243 return def_sym;
239 if (def_sym->visible != no)
240 return def_sym;
241 }
242 244
243 /* any of the defaults visible? */ 245 /* any of the defaults visible? */
244 for_all_defaults(sym, prop) { 246 for_all_defaults(sym, prop) {
@@ -246,18 +248,15 @@ static struct symbol *sym_calc_choice(struct symbol *sym)
246 if (prop->visible.tri == no) 248 if (prop->visible.tri == no)
247 continue; 249 continue;
248 def_sym = prop_get_symbol(prop); 250 def_sym = prop_get_symbol(prop);
249 sym_calc_visibility(def_sym);
250 if (def_sym->visible != no) 251 if (def_sym->visible != no)
251 return def_sym; 252 return def_sym;
252 } 253 }
253 254
254 /* just get the first visible value */ 255 /* just get the first visible value */
255 prop = sym_get_choice_prop(sym); 256 prop = sym_get_choice_prop(sym);
256 expr_list_for_each_sym(prop->expr, e, def_sym) { 257 expr_list_for_each_sym(prop->expr, e, def_sym)
257 sym_calc_visibility(def_sym);
258 if (def_sym->visible != no) 258 if (def_sym->visible != no)
259 return def_sym; 259 return def_sym;
260 }
261 260
262 /* no choice? reset tristate value */ 261 /* no choice? reset tristate value */
263 sym->curr.tri = no; 262 sym->curr.tri = no;
@@ -383,12 +382,13 @@ void sym_calc_value(struct symbol *sym)
383 382
384 if (sym_is_choice(sym)) { 383 if (sym_is_choice(sym)) {
385 struct symbol *choice_sym; 384 struct symbol *choice_sym;
386 int flags = sym->flags & (SYMBOL_CHANGED | SYMBOL_WRITE);
387 385
388 prop = sym_get_choice_prop(sym); 386 prop = sym_get_choice_prop(sym);
389 expr_list_for_each_sym(prop->expr, e, choice_sym) { 387 expr_list_for_each_sym(prop->expr, e, choice_sym) {
390 choice_sym->flags |= flags; 388 if ((sym->flags & SYMBOL_WRITE) &&
391 if (flags & SYMBOL_CHANGED) 389 choice_sym->visible != no)
390 choice_sym->flags |= SYMBOL_WRITE;
391 if (sym->flags & SYMBOL_CHANGED)
392 sym_set_changed(choice_sym); 392 sym_set_changed(choice_sym);
393 } 393 }
394 } 394 }