Skip to content

Commit 6902dcc

Browse files
yann-morin-1998michal42
authored andcommitted
kconfig: do not special-case 'MODULES' symbol
Currently, the 'MODULES' symbol is hard-coded to be the default symbol that enables/disables tristates, if no other symbol was declared with 'option modules'. While this used to be needed for the Linux kernel, we now have an explicit 'option modules' attached to the 'MODULES' symbol (since cset 11097a0), so we no longer need to special-case it in the kconfig code. Furthermore, kconfig is extensively used out of the Linux kernel, and other projects may have another meaning for a symbol named 'MODULES'. This patch changes the way we enable/disable tristates: if a symbol was found with 'option modules' attached to it, then that symbol controls enabling tristates. Otherwise, tristates are disabled, even if a symbol named 'MODULES' exists. 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>
1 parent c8272fa commit 6902dcc

2 files changed

Lines changed: 3 additions & 13 deletions

File tree

‎scripts/kconfig/menu.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,9 @@ void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep)
197197

198198
void menu_add_option(int token, char *arg)
199199
{
200-
struct property *prop;
201-
202200
switch (token) {
203201
case T_OPT_MODULES:
204-
prop = prop_alloc(P_DEFAULT, modules_sym);
205-
prop->expr = expr_alloc_symbol(current_entry->sym);
202+
modules_sym = current_entry->sym;
206203
break;
207204
case T_OPT_DEFCONFIG_LIST:
208205
if (!sym_defconfig_list)

‎scripts/kconfig/zconf.y‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -493,22 +493,15 @@ void conf_parse(const char *name)
493493

494494
sym_init();
495495
_menu_init();
496-
modules_sym = sym_lookup(NULL, 0);
497-
modules_sym->type = S_BOOLEAN;
498-
modules_sym->flags |= SYMBOL_AUTO;
499496
rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
500497

501498
if (getenv("ZCONF_DEBUG"))
502499
zconfdebug = 1;
503500
zconfparse();
504501
if (zconfnerrs)
505502
exit(1);
506-
if (!modules_sym->prop) {
507-
struct property *prop;
508-
509-
prop = prop_alloc(P_DEFAULT, modules_sym);
510-
prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0));
511-
}
503+
if (!modules_sym)
504+
modules_sym = sym_find( "n" );
512505

513506
rootmenu.prompt->text = _(rootmenu.prompt->text);
514507
rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);

0 commit comments

Comments
 (0)