linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 1/2] kconfig: warn unmet direct dependency of tristate symbols selected by y
@ 2018-03-13  9:56 Masahiro Yamada
  2018-03-13  9:56 ` [PATCH v4 2/2] kconfig: make unmet dependency warnings readable Masahiro Yamada
  2018-03-18 22:17 ` [PATCH v4 1/2] kconfig: warn unmet direct dependency of tristate symbols selected by y Eugeniu Rosca
  0 siblings, 2 replies; 4+ messages in thread
From: Masahiro Yamada @ 2018-03-13  9:56 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Sam Ravnborg, Ulf Magnusson, Eugeniu Rosca, Randy Dunlap,
	Luis R . Rodriguez, Petr Vorel, Masahiro Yamada, linux-kernel

Commit 246cf9c26bf1 ("kbuild: Warn on selecting symbols with unmet
direct dependencies") forcibly promoted ->dir_dep.tri to yes from mod.
So, the unmet direct dependencies of tristate symbols are not reported.

[Test Case]

  config MODULES
          def_bool y
          option modules

  config A
          def_bool y
          select B

  config B
          tristate "B"
          depends on m

This causes unmet dependency because 'B' is forced 'y' ignoring
'depends on m'.  This should be warned.

On the other hand, the following case ('B' is bool) should not be
warned, so 'depends on m' for bool symbols should be naturally treated
as 'depends on y'.

[Test Case2 (not unmet dependency)]

  config MODULES
          def_bool y
          option modules

  config A
          def_bool y
          select B

  config B
          bool "B"
          depends on m

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Changes in v4:
  - newly added


 scripts/kconfig/symbol.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 0f7eba7..def860b 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -243,7 +243,7 @@ static void sym_calc_visibility(struct symbol *sym)
 	tri = yes;
 	if (sym->dir_dep.expr)
 		tri = expr_calc_value(sym->dir_dep.expr);
-	if (tri == mod)
+	if (sym->type == S_BOOLEAN && tri == mod)
 		tri = yes;
 	if (sym->dir_dep.tri != tri) {
 		sym->dir_dep.tri = tri;
@@ -414,7 +414,7 @@ void sym_calc_value(struct symbol *sym)
 				}
 			}
 		calc_newval:
-			if (sym->dir_dep.tri == no && sym->rev_dep.tri != no) {
+			if (sym->dir_dep.tri < sym->rev_dep.tri) {
 				struct expr *e;
 				e = expr_simplify_unmet_dep(sym->rev_dep.expr,
 				    sym->dir_dep.expr);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-03-20  3:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-13  9:56 [PATCH v4 1/2] kconfig: warn unmet direct dependency of tristate symbols selected by y Masahiro Yamada
2018-03-13  9:56 ` [PATCH v4 2/2] kconfig: make unmet dependency warnings readable Masahiro Yamada
2018-03-18 22:17 ` [PATCH v4 1/2] kconfig: warn unmet direct dependency of tristate symbols selected by y Eugeniu Rosca
2018-03-20  3:57   ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).