Commit bae79439 authored by Roman Zippel's avatar Roman Zippel Committed by Linus Torvalds

[PATCH] Optional choice values get reset

Patch by Herbert Xu <herbert@gondor.apana.org.au>:

As of 2.5.74, make oldconfig always disables existing optional choices
even if they were selected previously.  For example, if all the EICON
ISDN drivers were selected as modules, then make oldconfig will turn
them off.

Part of the problem is that the choice value itself is computed before
the SYMBOL_NEW flag is turned off.  This patch addresses that particular
problem.
parent 669ee167
......@@ -115,6 +115,7 @@ int conf_read(const char *name)
while (fgets(line, sizeof(line), in)) {
lineno++;
sym = NULL;
switch (line[0]) {
case '#':
if (memcmp(line + 2, "CONFIG_", 7))
......@@ -133,7 +134,7 @@ int conf_read(const char *name)
switch (sym->type) {
case S_BOOLEAN:
case S_TRISTATE:
sym->user = symbol_no.curr;
sym->user.tri = no;
sym->flags &= ~SYMBOL_NEW;
break;
default:
......@@ -201,35 +202,36 @@ int conf_read(const char *name)
default:
;
}
if (sym_is_choice_value(sym)) {
struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym));
switch (sym->user.tri) {
case mod:
if (cs->user.tri == yes)
/* warn? */;
break;
case yes:
if (cs->user.tri != no)
/* warn? */;
cs->user.val = sym;
break;
case no:
break;
}
cs->user.tri = sym->user.tri;
}
break;
case '\n':
break;
default:
continue;
}
if (sym && sym_is_choice_value(sym)) {
struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym));
switch (sym->user.tri) {
case no:
break;
case mod:
if (cs->user.tri == yes)
/* warn? */;
break;
case yes:
if (cs->user.tri != no)
/* warn? */;
cs->user.val = sym;
break;
}
cs->user.tri = E_OR(cs->user.tri, sym->user.tri);
cs->flags &= ~SYMBOL_NEW;
}
}
fclose(in);
for_all_symbols(i, sym) {
sym_calc_value(sym);
if (sym_has_value(sym)) {
if (sym_has_value(sym) && !sym_is_choice_value(sym)) {
if (sym->visible == no)
sym->flags |= SYMBOL_NEW;
switch (sym->type) {
......@@ -245,7 +247,6 @@ int conf_read(const char *name)
if (!sym_is_choice(sym))
continue;
prop = sym_get_choice_prop(sym);
sym->flags &= ~SYMBOL_NEW;
for (e = prop->expr; e; e = e->left.expr)
if (e->right.sym->visible != no)
sym->flags |= e->right.sym->flags & SYMBOL_NEW;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment