kconfig: Warn if choice default is not in choice
[carl9170fw.git] / config / menu.c
index e9357931b47db3fdf7f63da842a045697e038ed9..ce88de89f146e3ce1c6d980130ff93bae1b992ce 100644 (file)
@@ -252,6 +252,16 @@ static void sym_check_prop(struct symbol *sym)
                                            "'%s': number is invalid",
                                            sym->name);
                        }
+                       if (sym_is_choice(sym)) {
+                               struct property *choice_prop =
+                                       sym_get_choice_prop(sym2);
+
+                               if (!choice_prop ||
+                                   prop_get_symbol(choice_prop) != sym)
+                                       prop_warn(prop,
+                                                 "choice default symbol '%s' is not contained in the choice",
+                                                 sym2->name);
+                       }
                        break;
                case P_SELECT:
                case P_IMPLY: