diff options
| author | Masahiro Yamada <[email protected]> | 2024-02-11 12:41:05 +0000 |
|---|---|---|
| committer | Masahiro Yamada <[email protected]> | 2024-02-20 11:47:45 +0000 |
| commit | 91b69454f93d1c905f3a56bb39856db9a220c791 (patch) | |
| tree | 626c49c3d828ca15576080f79ac94144b03984fd /scripts/kconfig/expr.h | |
| parent | kconfig: print recursive dependency errors in the parsed order (diff) | |
| download | kernel-91b69454f93d1c905f3a56bb39856db9a220c791.tar.gz kernel-91b69454f93d1c905f3a56bb39856db9a220c791.zip | |
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 <[email protected]>
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". |
