kconfig: use parent->dep as the parentdep of 'menu'
authorMasahiro Yamada <masahiroy@kernel.org>
Tue, 17 Dec 2019 04:14:17 +0000 (13:14 +0900)
committerChristian Lamparter <chunkeey@gmail.com>
Fri, 5 Feb 2021 10:47:52 +0000 (11:47 +0100)
In menu_finalize(), the dependency of a menu entry is propagated
downwards.

For the 'menu', parent->dep and parent->prompt->visible.expr have
the same expression. Both accumulate the 'depends on' of itself and
upper menu entries.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
config/menu.c

index b1b1ee8cf98704253402b5b89f12abde87612b83..bbabf0a59ac4e488052111c02f7e8bd29f29fc94 100644 (file)
@@ -326,12 +326,10 @@ void menu_finalize(struct menu *parent)
                         * choice value symbols.
                         */
                        parentdep = expr_alloc_symbol(sym);
-               } else if (parent->prompt)
-                       /* Menu node for 'menu' */
-                       parentdep = parent->prompt->visible.expr;
-               else
-                       /* Menu node for 'if' */
+               } else {
+                       /* Menu node for 'menu', 'if' */
                        parentdep = parent->dep;
+               }
 
                /* For each child menu node... */
                for (menu = parent->list; menu; menu = menu->next) {