]> www.infradead.org Git - nvme.git/commitdiff
kconfig: use sym_get_choice_menu() in sym_check_deps()
authorMasahiro Yamada <masahiroy@kernel.org>
Tue, 18 Jun 2024 10:35:29 +0000 (19:35 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Mon, 15 Jul 2024 16:08:37 +0000 (01:08 +0900)
Choices and their members are associated via the P_CHOICE property.

Currently, prop_get_symbol(sym_get_choice_prop()) is used to obtain
the choice of the given choice member.

Replace it with sym_get_choice_menu(), which retrieves the choice
without relying on P_CHOICE.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kconfig/symbol.c

index 22c15a1033711556498fe924c75a844e98be49a1..b50911bcb08d28479d75c4465f87abf489bd1b0d 100644 (file)
@@ -1295,8 +1295,8 @@ out:
 
 struct symbol *sym_check_deps(struct symbol *sym)
 {
+       struct menu *choice;
        struct symbol *sym2;
-       struct property *prop;
 
        if (sym->flags & SYMBOL_CHECK) {
                sym_check_print_recursive(sym);
@@ -1305,13 +1305,13 @@ struct symbol *sym_check_deps(struct symbol *sym)
        if (sym->flags & SYMBOL_CHECKED)
                return NULL;
 
-       if (sym_is_choice_value(sym)) {
+       choice = sym_get_choice_menu(sym);
+       if (choice) {
                struct dep_stack stack;
 
                /* for choice groups start the check with main choice symbol */
                dep_stack_insert(&stack, sym);
-               prop = sym_get_choice_prop(sym);
-               sym2 = sym_check_deps(prop_get_symbol(prop));
+               sym2 = sym_check_deps(choice->sym);
                dep_stack_remove();
        } else if (sym_is_choice(sym)) {
                sym2 = sym_check_choice_deps(sym);