diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2024-02-11 21:41:05 +0900 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2024-02-20 20:47:45 +0900 |
commit | 91b69454f93d1c905f3a56bb39856db9a220c791 (patch) | |
tree | 626c49c3d828ca15576080f79ac94144b03984fd /scripts/kconfig/expr.h | |
parent | cc25cfc563adc48c84f1eec6432b369bcab73ca6 (diff) |
kconfig: use generic macros to implement symbol hashtable
Use helper macros in hashtable.h for generic hashtable implementation.
We can git rid of the hash head index of for_all_symbols().
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/kconfig/expr.h')
-rw-r--r-- | scripts/kconfig/expr.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index dd3350aed302..3bc375f1a1cd 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h @@ -17,6 +17,8 @@ extern "C" { #include <stdbool.h> #endif +#include "list_types.h" + typedef enum tristate { no, mod, yes } tristate; @@ -74,8 +76,8 @@ enum { * SYMBOL_CHOICE bit set in 'flags'. */ struct symbol { - /* The next symbol in the same bucket in the symbol hash table */ - struct symbol *next; + /* link node for the hash table */ + struct hlist_node node; /* The name of the symbol, e.g. "FOO" for 'config FOO' */ char *name; @@ -124,8 +126,6 @@ struct symbol { struct expr_value implied; }; -#define for_all_symbols(i, sym) for (i = 0; i < SYMBOL_HASHSIZE; i++) for (sym = symbol_hash[i]; sym; sym = sym->next) - #define SYMBOL_CONST 0x0001 /* symbol is const */ #define SYMBOL_CHECK 0x0008 /* used during dependency checking */ #define SYMBOL_CHOICE 0x0010 /* start of a choice block (null name) */ @@ -150,7 +150,6 @@ struct symbol { #define SYMBOL_NEED_SET_CHOICE_VALUES 0x100000 #define SYMBOL_MAXLENGTH 256 -#define SYMBOL_HASHSIZE 9973 /* A property represent the config options that can be associated * with a config "symbol". |