From: Arnaud Lacombe Date: Wed, 8 Jun 2011 05:42:11 +0000 (-0400) Subject: kconfig: do not overwrite symbol direct dependency in assignment X-Git-Tag: firefly_0821_release~3680^2~4807^2~9 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ec6452a5ec68498221a0ced3443cefd65b08be36;p=firefly-linux-kernel-4.4.55.git kconfig: do not overwrite symbol direct dependency in assignment Considering the following configuration: config F bool "F" choice AB bool "AB" config A bool "A" config B bool "B" endchoice if A config D bool default y if F select E config E bool "E" endif if B config D bool default y if F select E config E bool "E" endif The following configuration: CONFIG_F=y CONFIG_A=y # CONFIG_B is not set CONFIG_D=y CONFIG_E=y emits a spurious warning: (D) selects E which has unmet direct dependencies (B) If a symbol appears in two different branch of the tree, it should inherit the dependency of both parent, not just the last one. Reported-by: Yann E. Morin Tested-by: Yann E. Morin Signed-off-by: Arnaud Lacombe Signed-off-by: Michal Marek --- diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index aab5a1fee5a8..d66008639a43 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -351,7 +351,7 @@ void menu_finalize(struct menu *parent) last_menu->next = NULL; } - sym->dir_dep.expr = parent->dep; + sym->dir_dep.expr = expr_alloc_or(sym->dir_dep.expr, parent->dep); } for (menu = parent->list; menu; menu = menu->next) { if (sym && sym_is_choice(sym) &&