History

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.

Masahiro Yamada committed 5 years ago

Commit 6dd85ff1 parent ab838579 files · +13 −27Browse files

Unified · Split

9 files
  1. Documentation/kbuild/kconfig-language.rst +4 −10
  2. init/Kconfig +1 −1
  3. scripts/kconfig/lexer.l +0 −1
  4. scripts/kconfig/lkc.h +0 −1
  5. scripts/kconfig/menu.c +0 −8
  6. scripts/kconfig/parser.y +5 −3
  7. scripts/kconfig/tests/choice/Kconfig +1 −1
  8. scripts/kconfig/tests/choice_value_with_m_dep/Kconfig +1 −1
  9. scripts/kconfig/tests/inter_choice/Kconfig +1 −1
Documentation/kbuild/kconfig-language.rst+4−10
@@ -223,16 +223,10 @@ applicable everywhere (see syntax). · 222 unmodified lines
223 the indentation level, this means it ends at the first line which has223 the indentation level, this means it ends at the first line which has
224 a smaller indentation than the first line of the help text.224 a smaller indentation than the first line of the help text.
225 225
226- misc options: "option" <symbol>[=<value>]226- module attribute: "modules"
227 227 This declares the symbol to be used as the MODULES symbol, which
228 Various less common options can be defined via this option syntax,228 enables the third modular state for all config symbols.
229 which can modify the behaviour of the menu entry and its config229 At most one symbol may have the "modules" option set.
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.
236 230
237Menu dependencies231Menu dependencies
238-----------------232-----------------
init/Kconfig+1−1
@@ -2042,7 +2042,7 @@ config MODULE_SIG_FORMAT · 2041 unmodified lines
2042 2042
2043menuconfig MODULES2043menuconfig MODULES
2044 bool "Enable loadable module support"2044 bool "Enable loadable module support"
2045 option modules2045 modules
2046 help2046 help
2047 Kernel modules are small pieces of compiled code which can2047 Kernel modules are small pieces of compiled code which can
2048 be inserted in the running kernel, rather than being2048 be inserted in the running kernel, rather than being
scripts/kconfig/lexer.l+0−1
@@ -112,7 +112,6 @@ n [A-Za-z0-9_-] · 111 unmodified lines
112"menuconfig" return T_MENUCONFIG;112"menuconfig" return T_MENUCONFIG;
113"modules" return T_MODULES;113"modules" return T_MODULES;
114"on" return T_ON;114"on" return T_ON;
115"option" return T_OPTION;
116"optional" return T_OPTIONAL;115"optional" return T_OPTIONAL;
117"prompt" return T_PROMPT;116"prompt" return T_PROMPT;
118"range" return T_RANGE;117"range" return T_RANGE;
scripts/kconfig/lkc.h+0−1
@@ -95,7 +95,6 @@ void menu_add_visibility(struct expr *dep); · 94 unmodified lines
95struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep);95struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep);
96void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep);96void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep);
97void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep);97void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep);
98void menu_add_option_modules(void);
99void menu_finalize(struct menu *parent);98void menu_finalize(struct menu *parent);
100void menu_set_type(int type);99void menu_set_type(int type);
101 100
scripts/kconfig/menu.c+0−8
@@ -211,14 +211,6 @@ void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep) · 210 unmodified lines
211 menu_add_prop(type, expr_alloc_symbol(sym), dep);211 menu_add_prop(type, expr_alloc_symbol(sym), dep);
212}212}
213 213
214void 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
222static int menu_validate_number(struct symbol *sym, struct symbol *sym2)214static int menu_validate_number(struct symbol *sym, struct symbol *sym2)
223{215{
224 return sym2->type == S_INT || sym2->type == S_HEX ||216 return sym2->type == S_INT || sym2->type == S_HEX ||
scripts/kconfig/parser.y+5−3
@@ -69,7 +69,6 @@ static struct menu *current_menu, *current_entry; · 68 unmodified lines
69%token T_MODULES69%token T_MODULES
70%token T_ON70%token T_ON
71%token T_OPEN_PAREN71%token T_OPEN_PAREN
72%token T_OPTION
73%token T_OPTIONAL72%token T_OPTIONAL
74%token T_PLUS_EQUAL73%token T_PLUS_EQUAL
75%token T_PROMPT74%token T_PROMPT
@@ -216,9 +215,12 @@ config_option: T_RANGE symbol symbol if_expr T_EOL · 140 unmodified lines
216 printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());215 printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
217};216};
218 217
219config_option: T_OPTION T_MODULES T_EOL218config_option: T_MODULES T_EOL
220{219{
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;
222};224};
223 225
224/* choice entry */226/* choice entry */
scripts/kconfig/tests/choice/Kconfig+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
2 2
3config MODULES3config MODULES
4 bool "Enable loadable module support"4 bool "Enable loadable module support"
5 option modules5 modules
6 default y6 default y
7 7
8choice8choice
scripts/kconfig/tests/choice_value_with_m_dep/Kconfig+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
2 2
3config MODULES3config MODULES
4 def_bool y4 def_bool y
5 option modules5 modules
6 6
7config DEP7config DEP
8 tristate8 tristate
scripts/kconfig/tests/inter_choice/Kconfig+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
2 2
3config MODULES3config MODULES
4 def_bool y4 def_bool y
5 option modules5 modules
6 6
7choice7choice
8 prompt "Choice"8 prompt "Choice"

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t