diff --git a/scripts/kconfig/kconf_id.c b/scripts/kconfig/kconf_id.c
index ec2c011f9e6263b52ca6e0bff724169ffe1a27d1..f8b222cc8b874d5b4347f3dc913d24c075d9130a 100644
--- a/scripts/kconfig/kconf_id.c
+++ b/scripts/kconfig/kconf_id.c
@@ -30,9 +30,6 @@ static struct kconf_id kconf_id_array[] = {
{ "visible", T_VISIBLE, TF_COMMAND },
{ "option", T_OPTION, TF_COMMAND },
{ "on", T_ON, TF_PARAM },
- { "modules", T_OPT_MODULES, TF_OPTION },
- { "defconfig_list", T_OPT_DEFCONFIG_LIST, TF_OPTION },
- { "allnoconfig_y", T_OPT_ALLNOCONFIG_Y, TF_OPTION },
};
#define KCONF_ID_ARRAY_SIZE (sizeof(kconf_id_array)/sizeof(struct kconf_id))
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index b6bbcd1dda2be89d3f2a6e63da92f6411c83f4ff..5f4880a12246a63671b7e8f1cda89e3d639dc45e 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -32,7 +32,6 @@ static inline const char *CONFIG_prefix(void)
#define TF_COMMAND 0x0001
#define TF_PARAM 0x0002
-#define TF_OPTION 0x0004
enum conf_def_mode {
def_default,
@@ -42,10 +41,6 @@ enum conf_def_mode {
def_random
};
-#define T_OPT_MODULES 1
-#define T_OPT_DEFCONFIG_LIST 2
-#define T_OPT_ALLNOCONFIG_Y 4
-
struct kconf_id {
const char *name;
int token;
@@ -90,7 +85,9 @@ void menu_add_visibility(struct expr *dep);
struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep);
void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep);
void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep);
-void menu_add_option(int token, char *arg);
+void menu_add_option_modules(void);
+void menu_add_option_defconfig_list(void);
+void menu_add_option_allnoconfig_y(void);
void menu_finalize(struct menu *parent);
void menu_set_type(int type);
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 4cf15d449c05d2a126d0a3fa9af592068b8ff5d7..7e2b2c938d7ba053b1ed2583b45596e081d39ecb 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -195,29 +195,26 @@ void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep)
menu_add_prop(type, NULL, expr_alloc_symbol(sym), dep);
}
-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:
- if (!sym_defconfig_list)
- sym_defconfig_list = current_entry->sym;
- else if (sym_defconfig_list != current_entry->sym)
- zconf_error("trying to redefine defconfig symbol");
- sym_defconfig_list->flags |= SYMBOL_NO_WRITE;
- break;
- case T_OPT_ALLNOCONFIG_Y:
- current_entry->sym->flags |= SYMBOL_ALLNOCONFIG_Y;
- break;
- }
+void menu_add_option_modules(void)
+{
+ 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;
+}
+
+void menu_add_option_defconfig_list(void)
+{
+ if (!sym_defconfig_list)
+ sym_defconfig_list = current_entry->sym;
+ else if (sym_defconfig_list != current_entry->sym)
+ zconf_error("trying to redefine defconfig symbol");
+ sym_defconfig_list->flags |= SYMBOL_NO_WRITE;
+}
+
+void menu_add_option_allnoconfig_y(void)
+{
+ current_entry->sym->flags |= SYMBOL_ALLNOCONFIG_Y;
}
static int menu_validate_number(struct symbol *sym, struct symbol *sym2)
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index 8e856f9e6da980c2e94a72f77f56154c61503e0d..30380790bab40939756dda16c5c4381b9e26d975 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -140,6 +140,9 @@ n [A-Za-z0-9_-]
}
{
+ "modules" return T_MODULES;
+ "defconfig_list" return T_DEFCONFIG_LIST;
+ "allnoconfig_y" return T_ALLNOCONFIG_Y;
"&&" return T_AND;
"||" return T_OR;
"(" return T_OPEN_PAREN;
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 19fa333e9aa1936ff0d5da21a3f27ff32d749ec0..e482000bb93e0c27fa462e8d06ac2bf04249dcc3 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -64,18 +64,21 @@ static struct menu *current_menu, *current_entry;
%token T_IMPLY
%token T_RANGE
%token T_VISIBLE
-%token T_OPTION
%token T_ON
%token T_WORD
%token T_WORD_QUOTE
+%token T_ALLNOCONFIG_Y
%token T_BOOL
%token T_CLOSE_PAREN
%token T_DEFAULT
+%token T_DEFCONFIG_LIST
%token T_DEF_BOOL
%token T_DEF_TRISTATE
%token T_HEX
%token T_INT
+%token T_MODULES
%token T_OPEN_PAREN
+%token T_OPTION
%token T_STRING
%token T_TRISTATE
%token T_EOL
@@ -97,7 +100,7 @@ static struct menu *current_menu, *current_entry;
%type if_expr
%type end
%type