kconfig: remove S_OTHER symbol type and correct dependency tracking
[carl9170fw.git] / config / confdata.c
index c0a4e51df3f56857c5f77c4027d55aed0a5ab822..f6168f2aaeacda3113fd117ddfc710f41721ae55 100644 (file)
@@ -227,14 +227,6 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
                        conf_warning("symbol value '%s' invalid for %s",
                                     p, sym->name);
                return 1;
-       case S_OTHER:
-               if (*p != '"') {
-                       for (p2 = p; *p2 && !isspace(*p2); p2++)
-                               ;
-                       sym->type = S_STRING;
-                       goto done;
-               }
-               /* fall through */
        case S_STRING:
                if (*p++ != '"')
                        break;
@@ -253,7 +245,6 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
                /* fall through */
        case S_INT:
        case S_HEX:
-       done:
                if (sym_string_valid(sym, p)) {
                        sym->def[def].val = xstrdup(p);
                        sym->flags |= def_flags;
@@ -434,17 +425,22 @@ load:
                                if (*p2 == '\r')
                                        *p2 = 0;
                        }
-                       if (def == S_DEF_USER) {
-                               sym = sym_find(line + strlen(CONFIG_));
-                               if (!sym) {
+
+                       sym = sym_find(line + strlen(CONFIG_));
+                       if (!sym) {
+                               if (def == S_DEF_AUTO)
+                                       /*
+                                        * Reading from include/config/auto.conf
+                                        * If CONFIG_FOO previously existed in
+                                        * auto.conf but it is missing now,
+                                        * include/config/foo.h must be touched.
+                                        */
+                                       conf_touch_dep(line + strlen(CONFIG_));
+                               else
                                        sym_add_change_count(1);
-                                       continue;
-                               }
-                       } else {
-                               sym = sym_lookup(line + strlen(CONFIG_), 0);
-                               if (sym->type == S_UNKNOWN)
-                                       sym->type = S_OTHER;
+                               continue;
                        }
+
                        if (sym->flags & def_flags) {
                                conf_warning("override: reassigning to symbol %s", sym->name);
                        }
@@ -756,7 +752,6 @@ static void conf_write_symbol(FILE *fp, struct symbol *sym,
        const char *str;
 
        switch (sym->type) {
-       case S_OTHER:
        case S_UNKNOWN:
                break;
        case S_STRING: