Skip to content

Commit 6dd85ff

Browse files
committed
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>
1 parent ab83857 commit 6dd85ff

File tree

9 files changed

+13
-27
lines changed

9 files changed

+13
-27
lines changed

Documentation/kbuild/kconfig-language.rst

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -223,16 +223,10 @@ applicable everywhere (see syntax).
223223
the indentation level, this means it ends at the first line which has
224224
a smaller indentation than the first line of the help text.
225225

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.
236230

237231
Menu dependencies
238232
-----------------

init/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2042,7 +2042,7 @@ config MODULE_SIG_FORMAT
20422042

20432043
menuconfig MODULES
20442044
bool "Enable loadable module support"
2045-
option modules
2045+
modules
20462046
help
20472047
Kernel modules are small pieces of compiled code which can
20482048
be inserted in the running kernel, rather than being

scripts/kconfig/lexer.l

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ n [A-Za-z0-9_-]
112112
"menuconfig" return T_MENUCONFIG;
113113
"modules" return T_MODULES;
114114
"on" return T_ON;
115-
"option" return T_OPTION;
116115
"optional" return T_OPTIONAL;
117116
"prompt" return T_PROMPT;
118117
"range" return T_RANGE;

scripts/kconfig/lkc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ void menu_add_visibility(struct expr *dep);
9595
struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep);
9696
void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep);
9797
void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep);
98-
void menu_add_option_modules(void);
9998
void menu_finalize(struct menu *parent);
10099
void menu_set_type(int type);
101100

scripts/kconfig/menu.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,6 @@ void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep)
211211
menu_add_prop(type, expr_alloc_symbol(sym), dep);
212212
}
213213

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-
222214
static int menu_validate_number(struct symbol *sym, struct symbol *sym2)
223215
{
224216
return sym2->type == S_INT || sym2->type == S_HEX ||

scripts/kconfig/parser.y

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ static struct menu *current_menu, *current_entry;
6969
%token T_MODULES
7070
%token T_ON
7171
%token T_OPEN_PAREN
72-
%token T_OPTION
7372
%token T_OPTIONAL
7473
%token T_PLUS_EQUAL
7574
%token T_PROMPT
@@ -216,9 +215,12 @@ config_option: T_RANGE symbol symbol if_expr T_EOL
216215
printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
217216
};
218217

219-
config_option: T_OPTION T_MODULES T_EOL
218+
config_option: T_MODULES T_EOL
220219
{
221-
menu_add_option_modules();
220+
if (modules_sym)
221+
zconf_error("symbol '%s' redefines option 'modules' already defined by symbol '%s'",
222+
current_entry->sym->name, modules_sym->name);
223+
modules_sym = current_entry->sym;
222224
};
223225

224226
/* choice entry */

scripts/kconfig/tests/choice/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
config MODULES
44
bool "Enable loadable module support"
5-
option modules
5+
modules
66
default y
77

88
choice

scripts/kconfig/tests/choice_value_with_m_dep/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
config MODULES
44
def_bool y
5-
option modules
5+
modules
66

77
config DEP
88
tristate

scripts/kconfig/tests/inter_choice/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
config MODULES
44
def_bool y
5-
option modules
5+
modules
66

77
choice
88
prompt "Choice"

0 commit comments

Comments
 (0)