]> Pileus Git - ~andy/linux/commitdiff
kconfig: do not allow more than one symbol to have 'option modules'
authorYann E. MORIN <yann.morin.1998@free.fr>
Tue, 3 Sep 2013 20:22:26 +0000 (22:22 +0200)
committerMichal Marek <mmarek@suse.cz>
Thu, 5 Sep 2013 09:10:08 +0000 (11:10 +0200)
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" <yann.morin.1998@free.fr>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Documentation/kbuild/kconfig-language.txt
scripts/kconfig/menu.c

index c858f8419ebafeeb7d700be52c919d6ee0770201..c420676c6fe31d3ac66c1b63f165888ccd0efd6e 100644 (file)
@@ -147,6 +147,7 @@ applicable everywhere (see syntax).
   - "modules"
     This declares the symbol to be used as the MODULES symbol, which
     enables the third modular state for all config symbols.
+    At most one symbol may have the "modules" option set.
 
   - "env"=<value>
     This imports the environment variable into Kconfig. It behaves like
index 3a9c674932607ca9c1bdc4d62a15a98829e9b213..c1d53200c306dc6202cbcc13555a05333c34411a 100644 (file)
@@ -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: