diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-12-11 20:01:10 +0900 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-12-28 20:44:38 +0900 |
commit | 979f2b2f7936f4b71a3100baf2d16c8057f027eb (patch) | |
tree | 02cc885fdf217e12d7cea210136a04fedf206667 /scripts/kconfig/kconf_id.c | |
parent | 4b31a32caf0a28e4726f1bf267ff8a804ed864e2 (diff) | |
download | linux-979f2b2f7936f4b71a3100baf2d16c8057f027eb.tar.bz2 |
kconfig: remove keyword lookup table entirely
Commit 7a88488bbc23 ("[PATCH] kconfig: use gperf for kconfig keywords")
introduced gperf for the keyword lookup.
Then, commit bb3290d91695 ("Remove gperf usage from toolchain") killed
the gperf use. As a result, the linear keyword search was left behind.
If we do not use gperf, there is no reason to have the separate table
of the keywords. Move all keywords back to the lexer.
I also refactored the lexer to remove the COMMAND and PARAM states.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/kconfig/kconf_id.c')
-rw-r--r-- | scripts/kconfig/kconf_id.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/scripts/kconfig/kconf_id.c b/scripts/kconfig/kconf_id.c deleted file mode 100644 index f8b222cc8b87..000000000000 --- a/scripts/kconfig/kconf_id.c +++ /dev/null @@ -1,49 +0,0 @@ - -static struct kconf_id kconf_id_array[] = { - { "mainmenu", T_MAINMENU, TF_COMMAND }, - { "menu", T_MENU, TF_COMMAND }, - { "endmenu", T_ENDMENU, TF_COMMAND }, - { "source", T_SOURCE, TF_COMMAND }, - { "choice", T_CHOICE, TF_COMMAND }, - { "endchoice", T_ENDCHOICE, TF_COMMAND }, - { "comment", T_COMMENT, TF_COMMAND }, - { "config", T_CONFIG, TF_COMMAND }, - { "menuconfig", T_MENUCONFIG, TF_COMMAND }, - { "help", T_HELP, TF_COMMAND }, - { "---help---", T_HELP, TF_COMMAND }, - { "if", T_IF, TF_COMMAND|TF_PARAM }, - { "endif", T_ENDIF, TF_COMMAND }, - { "depends", T_DEPENDS, TF_COMMAND }, - { "optional", T_OPTIONAL, TF_COMMAND }, - { "default", T_DEFAULT, TF_COMMAND }, - { "def_bool", T_DEF_BOOL, TF_COMMAND }, - { "def_tristate", T_DEF_TRISTATE, TF_COMMAND }, - { "prompt", T_PROMPT, TF_COMMAND }, - { "bool", T_BOOL, TF_COMMAND }, - { "tristate", T_TRISTATE, TF_COMMAND }, - { "int", T_INT, TF_COMMAND }, - { "hex", T_HEX, TF_COMMAND }, - { "string", T_STRING, TF_COMMAND }, - { "select", T_SELECT, TF_COMMAND }, - { "imply", T_IMPLY, TF_COMMAND }, - { "range", T_RANGE, TF_COMMAND }, - { "visible", T_VISIBLE, TF_COMMAND }, - { "option", T_OPTION, TF_COMMAND }, - { "on", T_ON, TF_PARAM }, -}; - -#define KCONF_ID_ARRAY_SIZE (sizeof(kconf_id_array)/sizeof(struct kconf_id)) - -static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len) -{ - int i; - - for (i = 0; i < KCONF_ID_ARRAY_SIZE; i++) { - struct kconf_id *id = kconf_id_array+i; - int l = strlen(id->name); - - if (len == l && !memcmp(str, id->name, len)) - return id; - } - return NULL; -} |