kconfig: report recursive dependency involving 'imply'
[carl9170fw.git] / config / symbol.c
index 073d780f7ec9fb175cb973e4564ad397bfca0620..90e706096af8221d23a26be37d83678dcfddfe36 100644 (file)
@@ -1098,7 +1098,7 @@ static void sym_check_print_recursive(struct symbol *last_sym)
                                sym->name ? sym->name : "<choice>",
                                next_sym->name ? next_sym->name : "<choice>");
                } else {
-                       fprintf(stderr, "%s:%d:\tsymbol %s is selected by %s\n",
+                       fprintf(stderr, "%s:%d:\tsymbol %s is selected or implied by %s\n",
                                prop->file->name, prop->lineno,
                                sym->name ? sym->name : "<choice>",
                                next_sym->name ? next_sym->name : "<choice>");
@@ -1161,8 +1161,13 @@ static struct symbol *sym_check_sym_deps(struct symbol *sym)
        if (sym2)
                goto out;
 
+       sym2 = sym_check_expr_deps(sym->implied.expr);
+       if (sym2)
+               goto out;
+
        for (prop = sym->prop; prop; prop = prop->next) {
-               if (prop->type == P_CHOICE || prop->type == P_SELECT)
+               if (prop->type == P_CHOICE || prop->type == P_SELECT ||
+                   prop->type == P_IMPLY)
                        continue;
                stack.prop = prop;
                sym2 = sym_check_expr_deps(prop->visible.expr);
@@ -1248,9 +1253,6 @@ struct symbol *sym_check_deps(struct symbol *sym)
                sym->flags &= ~SYMBOL_CHECK;
        }
 
-       if (sym2 && sym2 == sym)
-               sym2 = NULL;
-
        return sym2;
 }
 
@@ -1289,8 +1291,6 @@ const char *prop_get_type_name(enum prop_type type)
        switch (type) {
        case P_PROMPT:
                return "prompt";
-       case P_ENV:
-               return "env";
        case P_COMMENT:
                return "comment";
        case P_MENU: