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)
committerMasahiro Yamada <masahiroy@kernel.org>
Mon, 6 Jan 2020 17:18:44 +0000 (02:18 +0900)
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>
scripts/kconfig/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) {