From: Yann E. MORIN Date: Tue, 3 Sep 2013 20:22:26 +0000 (+0200) Subject: kconfig: do not allow more than one symbol to have 'option modules' X-Git-Tag: 1.9.9~6 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=3318b89864b3bcd8fa5fc545ee8725e7a38c5a63;p=carl9170fw.git kconfig: do not allow more than one symbol to have 'option modules' Previously, it was possible to have more than one symbol with the 'option modules' attached to them, although only the last one would in fact control tristates. Since this does not make much sense, only allow at most one symbol to control tristates. Note: it is still possible to have more than one symbol that control tristates, but indirectly: config MOD1 bool "mod1" select MODULES config MOD2 bool "mod2" select MODULES config MODULES bool option modules Signed-off-by: "Yann E. MORIN" Cc: Sam Ravnborg Signed-off-by: Michal Marek Signed-off-by: Christian Lamparter --- diff --git a/config/menu.c b/config/menu.c index 3a9c674..c1d5320 100644 --- a/config/menu.c +++ b/config/menu.c @@ -199,6 +199,12 @@ void menu_add_option(int token, char *arg) { switch (token) { case T_OPT_MODULES: + if (modules_sym) + zconf_error("symbol '%s' redefines option 'modules'" + " already defined by symbol '%s'", + current_entry->sym->name, + modules_sym->name + ); modules_sym = current_entry->sym; break; case T_OPT_DEFCONFIG_LIST: