diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2024-03-03 05:00:33 +0100 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2024-03-09 07:01:00 +0100 |
commit | e0492219a6d752942b054cbfbbcbc1e8ab294d26 (patch) | |
tree | 152e81501cac71ee57ea0d51017c4d8916e74715 /scripts/kconfig/symbol.c | |
parent | kbuild: fix inconsistent indentation in top Makefile (diff) | |
download | linux-e0492219a6d752942b054cbfbbcbc1e8ab294d26.tar.xz linux-e0492219a6d752942b054cbfbbcbc1e8ab294d26.zip |
kconfig: link menus to a symbol
Currently, there is no direct link from (struct symbol) to (struct menu).
It is still possible to access associated menus through the P_SYMBOL
property, because property::menu is the relevant menu entry, but it
results in complex code, as seen in get_symbol_str().
Use a linked list for simpler traversal of relevant menus.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
Diffstat (limited to '')
-rw-r--r-- | scripts/kconfig/symbol.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index dd5cf9727a9a..81fe1884ef8a 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -15,18 +15,21 @@ struct symbol symbol_yes = { .name = "y", .curr = { "y", yes }, + .menus = LIST_HEAD_INIT(symbol_yes.menus), .flags = SYMBOL_CONST|SYMBOL_VALID, }; struct symbol symbol_mod = { .name = "m", .curr = { "m", mod }, + .menus = LIST_HEAD_INIT(symbol_mod.menus), .flags = SYMBOL_CONST|SYMBOL_VALID, }; struct symbol symbol_no = { .name = "n", .curr = { "n", no }, + .menus = LIST_HEAD_INIT(symbol_no.menus), .flags = SYMBOL_CONST|SYMBOL_VALID, }; @@ -838,6 +841,7 @@ struct symbol *sym_lookup(const char *name, int flags) symbol->name = new_name; symbol->type = S_UNKNOWN; symbol->flags = flags; + INIT_LIST_HEAD(&symbol->menus); hash_add(sym_hashtable, &symbol->node, hash); |