Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kconfig: change "modules" from sub-option to first-level attribute

Now "modules" is the only member of the "option" property.

Remove "option", and move "modules" to the top level property.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

+13 -27
+4 -10
Documentation/kbuild/kconfig-language.rst
··· 223 223 the indentation level, this means it ends at the first line which has 224 224 a smaller indentation than the first line of the help text. 225 225 226 - - misc options: "option" <symbol>[=<value>] 227 - 228 - Various less common options can be defined via this option syntax, 229 - which can modify the behaviour of the menu entry and its config 230 - symbol. These options are currently possible: 231 - 232 - - "modules" 233 - This declares the symbol to be used as the MODULES symbol, which 234 - enables the third modular state for all config symbols. 235 - At most one symbol may have the "modules" option set. 226 + - module attribute: "modules" 227 + This declares the symbol to be used as the MODULES symbol, which 228 + enables the third modular state for all config symbols. 229 + At most one symbol may have the "modules" option set. 236 230 237 231 Menu dependencies 238 232 -----------------
+1 -1
init/Kconfig
··· 2042 2042 2043 2043 menuconfig MODULES 2044 2044 bool "Enable loadable module support" 2045 - option modules 2045 + modules 2046 2046 help 2047 2047 Kernel modules are small pieces of compiled code which can 2048 2048 be inserted in the running kernel, rather than being
-1
scripts/kconfig/lexer.l
··· 112 112 "menuconfig" return T_MENUCONFIG; 113 113 "modules" return T_MODULES; 114 114 "on" return T_ON; 115 - "option" return T_OPTION; 116 115 "optional" return T_OPTIONAL; 117 116 "prompt" return T_PROMPT; 118 117 "range" return T_RANGE;
-1
scripts/kconfig/lkc.h
··· 95 95 struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep); 96 96 void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep); 97 97 void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep); 98 - void menu_add_option_modules(void); 99 98 void menu_finalize(struct menu *parent); 100 99 void menu_set_type(int type); 101 100
-8
scripts/kconfig/menu.c
··· 211 211 menu_add_prop(type, expr_alloc_symbol(sym), dep); 212 212 } 213 213 214 - void menu_add_option_modules(void) 215 - { 216 - if (modules_sym) 217 - zconf_error("symbol '%s' redefines option 'modules' already defined by symbol '%s'", 218 - current_entry->sym->name, modules_sym->name); 219 - modules_sym = current_entry->sym; 220 - } 221 - 222 214 static int menu_validate_number(struct symbol *sym, struct symbol *sym2) 223 215 { 224 216 return sym2->type == S_INT || sym2->type == S_HEX ||
+5 -3
scripts/kconfig/parser.y
··· 69 69 %token T_MODULES 70 70 %token T_ON 71 71 %token T_OPEN_PAREN 72 - %token T_OPTION 73 72 %token T_OPTIONAL 74 73 %token T_PLUS_EQUAL 75 74 %token T_PROMPT ··· 215 216 printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno()); 216 217 }; 217 218 218 - config_option: T_OPTION T_MODULES T_EOL 219 + config_option: T_MODULES T_EOL 219 220 { 220 - menu_add_option_modules(); 221 + if (modules_sym) 222 + zconf_error("symbol '%s' redefines option 'modules' already defined by symbol '%s'", 223 + current_entry->sym->name, modules_sym->name); 224 + modules_sym = current_entry->sym; 221 225 }; 222 226 223 227 /* choice entry */
+1 -1
scripts/kconfig/tests/choice/Kconfig
··· 2 2 3 3 config MODULES 4 4 bool "Enable loadable module support" 5 - option modules 5 + modules 6 6 default y 7 7 8 8 choice
+1 -1
scripts/kconfig/tests/choice_value_with_m_dep/Kconfig
··· 2 2 3 3 config MODULES 4 4 def_bool y 5 - option modules 5 + modules 6 6 7 7 config DEP 8 8 tristate
+1 -1
scripts/kconfig/tests/inter_choice/Kconfig
··· 2 2 3 3 config MODULES 4 4 def_bool y 5 - option modules 5 + modules 6 6 7 7 choice 8 8 prompt "Choice"