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) ...@@ -115,6 +115,7 @@ int conf_read(const char *name)
while (fgets(line, sizeof(line), in)) { while (fgets(line, sizeof(line), in)) {
lineno++; lineno++;
sym = NULL;
switch (line[0]) { switch (line[0]) {
case '#': case '#':
if (memcmp(line + 2, "CONFIG_", 7)) if (memcmp(line + 2, "CONFIG_", 7))
...@@ -133,7 +134,7 @@ int conf_read(const char *name) ...@@ -133,7 +134,7 @@ int conf_read(const char *name)
switch (sym->type) { switch (sym->type) {
case S_BOOLEAN: case S_BOOLEAN:
case S_TRISTATE: case S_TRISTATE:
sym->user = symbol_no.curr; sym->user.tri = no;
sym->flags &= ~SYMBOL_NEW; sym->flags &= ~SYMBOL_NEW;
break; break;
default: default:
...@@ -201,35 +202,36 @@ int conf_read(const char *name) ...@@ -201,35 +202,36 @@ int conf_read(const char *name)
default: 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; break;
case '\n': case '\n':
break; break;
default: default:
continue; 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); fclose(in);
for_all_symbols(i, sym) { for_all_symbols(i, sym) {
sym_calc_value(sym); sym_calc_value(sym);
if (sym_has_value(sym)) { if (sym_has_value(sym) && !sym_is_choice_value(sym)) {
if (sym->visible == no) if (sym->visible == no)
sym->flags |= SYMBOL_NEW; sym->flags |= SYMBOL_NEW;
switch (sym->type) { switch (sym->type) {
...@@ -245,7 +247,6 @@ int conf_read(const char *name) ...@@ -245,7 +247,6 @@ int conf_read(const char *name)
if (!sym_is_choice(sym)) if (!sym_is_choice(sym))
continue; continue;
prop = sym_get_choice_prop(sym); prop = sym_get_choice_prop(sym);
sym->flags &= ~SYMBOL_NEW;
for (e = prop->expr; e; e = e->left.expr) for (e = prop->expr; e; e = e->left.expr)
if (e->right.sym->visible != no) if (e->right.sym->visible != no)
sym->flags |= e->right.sym->flags & SYMBOL_NEW; 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