diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2024-03-03 13:00:33 +0900 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2024-03-09 15:01:00 +0900 |
commit | e0492219a6d752942b054cbfbbcbc1e8ab294d26 (patch) | |
tree | 152e81501cac71ee57ea0d51017c4d8916e74715 /scripts/kconfig/menu.c | |
parent | 50a339981780e233a5be88b9116a6dfd0e00231a (diff) | |
download | lwn-e0492219a6d752942b054cbfbbcbc1e8ab294d26.tar.gz lwn-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 'scripts/kconfig/menu.c')
-rw-r--r-- | scripts/kconfig/menu.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 44465945d6b1..571394ed71e0 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -57,8 +57,10 @@ void menu_add_entry(struct symbol *sym) *last_entry_ptr = menu; last_entry_ptr = &menu->next; current_entry = menu; - if (sym) + if (sym) { menu_add_symbol(P_SYMBOL, sym, NULL); + list_add_tail(&menu->link, &sym->menus); + } } struct menu *menu_add_menu(void) |