]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Optional choice values get reset
authorRoman Zippel <zippel@linux-m68k.org>
Fri, 25 Jul 2003 08:50:07 +0000 (01:50 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Fri, 25 Jul 2003 08:50:07 +0000 (01:50 -0700)
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.

scripts/kconfig/confdata.c

index 9ca70d081d1b3fd791390a4ad88be72a52bef5b3..abbd6cf01885914202f6f4a892aabebd298d481d 100644 (file)
@@ -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;