diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2006-06-08 22:12:41 -0700 |
---|---|---|
committer | Sam Ravnborg <sam@mars.ravnborg.org> | 2006-06-09 07:31:30 +0200 |
commit | 0c1822e6991a10da6dc391f0a2e2cf5fb2e31238 (patch) | |
tree | f86393b38a29d7f5e3ef34b060e04fb34c283044 /scripts/kconfig/symbol.c | |
parent | c0e150acde52e4661675539bf5323309270f2e83 (diff) | |
download | linux-0c1822e6991a10da6dc391f0a2e2cf5fb2e31238.tar.gz linux-0c1822e6991a10da6dc391f0a2e2cf5fb2e31238.tar.bz2 linux-0c1822e6991a10da6dc391f0a2e2cf5fb2e31238.zip |
kconfig: allow multiple default values per symbol
Extend struct symbol to allow storing multiple default values, which can be
used to hold multiple configurations.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/kconfig/symbol.c')
-rw-r--r-- | scripts/kconfig/symbol.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index a0a467a4387b..4ea0050dcb16 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -227,7 +227,7 @@ static struct symbol *sym_calc_choice(struct symbol *sym) struct expr *e; /* is the user choice visible? */ - def_sym = sym->user.val; + def_sym = sym->def[S_DEF_USER].val; if (def_sym) { sym_calc_visibility(def_sym); if (def_sym->visible != no) @@ -306,7 +306,7 @@ void sym_calc_value(struct symbol *sym) } else if (E_OR(sym->visible, sym->rev_dep.tri) != no) { sym->flags |= SYMBOL_WRITE; if (sym_has_value(sym)) - newval.tri = sym->user.tri; + newval.tri = sym->def[S_DEF_USER].tri; else if (!sym_is_choice(sym)) { prop = sym_get_default_prop(sym); if (prop) @@ -329,7 +329,7 @@ void sym_calc_value(struct symbol *sym) if (sym->visible != no) { sym->flags |= SYMBOL_WRITE; if (sym_has_value(sym)) { - newval.val = sym->user.val; + newval.val = sym->def[S_DEF_USER].val; break; } } @@ -439,7 +439,7 @@ bool sym_set_tristate_value(struct symbol *sym, tristate val) struct property *prop; struct expr *e; - cs->user.val = sym; + cs->def[S_DEF_USER].val = sym; cs->flags &= ~SYMBOL_NEW; prop = sym_get_choice_prop(cs); for (e = prop->expr; e; e = e->left.expr) { @@ -448,7 +448,7 @@ bool sym_set_tristate_value(struct symbol *sym, tristate val) } } - sym->user.tri = val; + sym->def[S_DEF_USER].tri = val; if (oldval != val) { sym_clear_all_valid(); if (sym == modules_sym) @@ -596,15 +596,15 @@ bool sym_set_string_value(struct symbol *sym, const char *newval) sym_set_changed(sym); } - oldval = sym->user.val; + oldval = sym->def[S_DEF_USER].val; size = strlen(newval) + 1; if (sym->type == S_HEX && (newval[0] != '0' || (newval[1] != 'x' && newval[1] != 'X'))) { size += 2; - sym->user.val = val = malloc(size); + sym->def[S_DEF_USER].val = val = malloc(size); *val++ = '0'; *val++ = 'x'; } else if (!oldval || strcmp(oldval, newval)) - sym->user.val = val = malloc(size); + sym->def[S_DEF_USER].val = val = malloc(size); else return true; |