kconfig: strip 'CONFIG_' automatically in kernel configuration search
[powerpc.git] / scripts / kconfig / symbol.c
index 78a60ba..c35dcc5 100644 (file)
@@ -30,7 +30,7 @@ struct symbol symbol_yes = {
        .flags = SYMBOL_VALID,
 };
 
-int sym_change_count;
+struct symbol *sym_defconfig_list;
 struct symbol *modules_sym;
 tristate modules_val;
 
@@ -352,10 +352,13 @@ void sym_calc_value(struct symbol *sym)
                sym->curr.val = sym_calc_choice(sym);
        sym_validate_range(sym);
 
-       if (memcmp(&oldval, &sym->curr, sizeof(oldval)))
+       if (memcmp(&oldval, &sym->curr, sizeof(oldval))) {
                sym_set_changed(sym);
-       if (modules_sym == sym)
-               modules_val = modules_sym->curr.tri;
+               if (modules_sym == sym) {
+                       sym_set_all_changed();
+                       modules_val = modules_sym->curr.tri;
+               }
+       }
 
        if (sym_is_choice(sym)) {
                int flags = sym->flags & (SYMBOL_CHANGED | SYMBOL_WRITE);
@@ -375,7 +378,7 @@ void sym_clear_all_valid(void)
 
        for_all_symbols(i, sym)
                sym->flags &= ~SYMBOL_VALID;
-       sym_change_count++;
+       sym_add_change_count(1);
        if (modules_sym)
                sym_calc_value(modules_sym);
 }
@@ -449,11 +452,8 @@ bool sym_set_tristate_value(struct symbol *sym, tristate val)
        }
 
        sym->def[S_DEF_USER].tri = val;
-       if (oldval != val) {
+       if (oldval != val)
                sym_clear_all_valid();
-               if (sym == modules_sym)
-                       sym_set_all_changed();
-       }
 
        return true;
 }
@@ -786,13 +786,15 @@ static struct symbol *sym_check_expr_deps(struct expr *e)
        return NULL;
 }
 
+/* return NULL when dependencies are OK */
 struct symbol *sym_check_deps(struct symbol *sym)
 {
        struct symbol *sym2;
        struct property *prop;
 
        if (sym->flags & SYMBOL_CHECK) {
-               printf("Warning! Found recursive dependency: %s", sym->name);
+               fprintf(stderr, "%s:%d:error: found recursive dependency: %s",
+                       sym->prop->file->name, sym->prop->lineno, sym->name);
                return sym;
        }
        if (sym->flags & SYMBOL_CHECKED)
@@ -816,13 +818,8 @@ struct symbol *sym_check_deps(struct symbol *sym)
                        goto out;
        }
 out:
-       if (sym2) {
-               printf(" %s", sym->name);
-               if (sym2 == sym) {
-                       printf("\n");
-                       sym2 = NULL;
-               }
-       }
+       if (sym2)
+               fprintf(stderr, " -> %s%s", sym->name, sym2 == sym? "\n": "");
        sym->flags &= ~SYMBOL_CHECK;
        return sym2;
 }