diff options
Diffstat (limited to 'scripts/kconfig/symbol.c')
-rw-r--r-- | scripts/kconfig/symbol.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 45f409a8f37f..18f3e5c33634 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c | |||
@@ -40,7 +40,7 @@ void sym_add_default(struct symbol *sym, const char *def) | |||
40 | { | 40 | { |
41 | struct property *prop = prop_alloc(P_DEFAULT, sym); | 41 | struct property *prop = prop_alloc(P_DEFAULT, sym); |
42 | 42 | ||
43 | prop->expr = expr_alloc_symbol(sym_lookup(def, 1)); | 43 | prop->expr = expr_alloc_symbol(sym_lookup(def, SYMBOL_CONST)); |
44 | } | 44 | } |
45 | 45 | ||
46 | void sym_init(void) | 46 | void sym_init(void) |
@@ -350,9 +350,6 @@ void sym_calc_value(struct symbol *sym) | |||
350 | ; | 350 | ; |
351 | } | 351 | } |
352 | 352 | ||
353 | if (sym->flags & SYMBOL_AUTO) | ||
354 | sym->flags &= ~SYMBOL_WRITE; | ||
355 | |||
356 | sym->curr = newval; | 353 | sym->curr = newval; |
357 | if (sym_is_choice(sym) && newval.tri == yes) | 354 | if (sym_is_choice(sym) && newval.tri == yes) |
358 | sym->curr.val = sym_calc_choice(sym); | 355 | sym->curr.val = sym_calc_choice(sym); |
@@ -377,6 +374,9 @@ void sym_calc_value(struct symbol *sym) | |||
377 | sym_set_changed(choice_sym); | 374 | sym_set_changed(choice_sym); |
378 | } | 375 | } |
379 | } | 376 | } |
377 | |||
378 | if (sym->flags & SYMBOL_AUTO) | ||
379 | sym->flags &= ~SYMBOL_WRITE; | ||
380 | } | 380 | } |
381 | 381 | ||
382 | void sym_clear_all_valid(void) | 382 | void sym_clear_all_valid(void) |
@@ -651,7 +651,7 @@ bool sym_is_changable(struct symbol *sym) | |||
651 | return sym->visible > sym->rev_dep.tri; | 651 | return sym->visible > sym->rev_dep.tri; |
652 | } | 652 | } |
653 | 653 | ||
654 | struct symbol *sym_lookup(const char *name, int isconst) | 654 | struct symbol *sym_lookup(const char *name, int flags) |
655 | { | 655 | { |
656 | struct symbol *symbol; | 656 | struct symbol *symbol; |
657 | const char *ptr; | 657 | const char *ptr; |
@@ -671,11 +671,10 @@ struct symbol *sym_lookup(const char *name, int isconst) | |||
671 | hash &= 0xff; | 671 | hash &= 0xff; |
672 | 672 | ||
673 | for (symbol = symbol_hash[hash]; symbol; symbol = symbol->next) { | 673 | for (symbol = symbol_hash[hash]; symbol; symbol = symbol->next) { |
674 | if (!strcmp(symbol->name, name)) { | 674 | if (!strcmp(symbol->name, name) && |
675 | if ((isconst && symbol->flags & SYMBOL_CONST) || | 675 | (flags ? symbol->flags & flags |
676 | (!isconst && !(symbol->flags & SYMBOL_CONST))) | 676 | : !(symbol->flags & (SYMBOL_CONST|SYMBOL_CHOICE)))) |
677 | return symbol; | 677 | return symbol; |
678 | } | ||
679 | } | 678 | } |
680 | new_name = strdup(name); | 679 | new_name = strdup(name); |
681 | } else { | 680 | } else { |
@@ -687,8 +686,7 @@ struct symbol *sym_lookup(const char *name, int isconst) | |||
687 | memset(symbol, 0, sizeof(*symbol)); | 686 | memset(symbol, 0, sizeof(*symbol)); |
688 | symbol->name = new_name; | 687 | symbol->name = new_name; |
689 | symbol->type = S_UNKNOWN; | 688 | symbol->type = S_UNKNOWN; |
690 | if (isconst) | 689 | symbol->flags |= flags; |
691 | symbol->flags |= SYMBOL_CONST; | ||
692 | 690 | ||
693 | symbol->next = symbol_hash[hash]; | 691 | symbol->next = symbol_hash[hash]; |
694 | symbol_hash[hash] = symbol; | 692 | symbol_hash[hash] = symbol; |
@@ -962,7 +960,7 @@ void prop_add_env(const char *env) | |||
962 | } | 960 | } |
963 | 961 | ||
964 | prop = prop_alloc(P_ENV, sym); | 962 | prop = prop_alloc(P_ENV, sym); |
965 | prop->expr = expr_alloc_symbol(sym_lookup(env, 1)); | 963 | prop->expr = expr_alloc_symbol(sym_lookup(env, SYMBOL_CONST)); |
966 | 964 | ||
967 | sym_env_list = expr_alloc_one(E_LIST, sym_env_list); | 965 | sym_env_list = expr_alloc_one(E_LIST, sym_env_list); |
968 | sym_env_list->right.sym = sym; | 966 | sym_env_list->right.sym = sym; |