diff options
Diffstat (limited to 'scripts/kconfig/menu.c')
-rw-r--r-- | scripts/kconfig/menu.c | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index e6ef171e5b14..fdad17367f61 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c | |||
@@ -242,9 +242,11 @@ void menu_finalize(struct menu *parent) | |||
242 | for (menu = parent->list; menu; menu = menu->next) { | 242 | for (menu = parent->list; menu; menu = menu->next) { |
243 | if (menu->sym) { | 243 | if (menu->sym) { |
244 | current_entry = parent; | 244 | current_entry = parent; |
245 | menu_set_type(menu->sym->type); | 245 | if (sym->type == S_UNKNOWN) |
246 | menu_set_type(menu->sym->type); | ||
246 | current_entry = menu; | 247 | current_entry = menu; |
247 | menu_set_type(sym->type); | 248 | if (menu->sym->type == S_UNKNOWN) |
249 | menu_set_type(sym->type); | ||
248 | break; | 250 | break; |
249 | } | 251 | } |
250 | } | 252 | } |
@@ -329,7 +331,37 @@ void menu_finalize(struct menu *parent) | |||
329 | "values not supported"); | 331 | "values not supported"); |
330 | } | 332 | } |
331 | current_entry = menu; | 333 | current_entry = menu; |
332 | menu_set_type(sym->type); | 334 | if (menu->sym->type == S_UNKNOWN) |
335 | menu_set_type(sym->type); | ||
336 | /* Non-tristate choice values of tristate choices must | ||
337 | * depend on the choice being set to Y. The choice | ||
338 | * values' dependencies were propagated to their | ||
339 | * properties above, so the change here must be re- | ||
340 | * propagated. */ | ||
341 | if (sym->type == S_TRISTATE && menu->sym->type != S_TRISTATE) { | ||
342 | basedep = expr_alloc_comp(E_EQUAL, sym, &symbol_yes); | ||
343 | basedep = expr_alloc_and(basedep, menu->dep); | ||
344 | basedep = expr_eliminate_dups(basedep); | ||
345 | menu->dep = basedep; | ||
346 | for (prop = menu->sym->prop; prop; prop = prop->next) { | ||
347 | if (prop->menu != menu) | ||
348 | continue; | ||
349 | dep = expr_alloc_and(expr_copy(basedep), | ||
350 | prop->visible.expr); | ||
351 | dep = expr_eliminate_dups(dep); | ||
352 | dep = expr_trans_bool(dep); | ||
353 | prop->visible.expr = dep; | ||
354 | if (prop->type == P_SELECT) { | ||
355 | struct symbol *es = prop_get_symbol(prop); | ||
356 | dep2 = expr_alloc_symbol(menu->sym); | ||
357 | dep = expr_alloc_and(dep2, | ||
358 | expr_copy(dep)); | ||
359 | dep = expr_alloc_or(es->rev_dep.expr, dep); | ||
360 | dep = expr_eliminate_dups(dep); | ||
361 | es->rev_dep.expr = dep; | ||
362 | } | ||
363 | } | ||
364 | } | ||
333 | menu_add_symbol(P_CHOICE, sym, NULL); | 365 | menu_add_symbol(P_CHOICE, sym, NULL); |
334 | prop = sym_get_choice_prop(sym); | 366 | prop = sym_get_choice_prop(sym); |
335 | for (ep = &prop->expr; *ep; ep = &(*ep)->left.expr) | 367 | for (ep = &prop->expr; *ep; ep = &(*ep)->left.expr) |