Skip to content

Commit f622f82

Browse files
committed
kconfig: warn unmet direct dependency of tristate symbols selected by y
Commit 246cf9c ("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 <[email protected]>
1 parent e2c75e7 commit f622f82

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/kconfig/symbol.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ static void sym_calc_visibility(struct symbol *sym)
243243
tri = yes;
244244
if (sym->dir_dep.expr)
245245
tri = expr_calc_value(sym->dir_dep.expr);
246-
if (tri == mod)
246+
if (tri == mod && sym_get_type(sym) == S_BOOLEAN)
247247
tri = yes;
248248
if (sym->dir_dep.tri != tri) {
249249
sym->dir_dep.tri = tri;
@@ -414,7 +414,7 @@ void sym_calc_value(struct symbol *sym)
414414
}
415415
}
416416
calc_newval:
417-
if (sym->dir_dep.tri == no && sym->rev_dep.tri != no) {
417+
if (sym->dir_dep.tri < sym->rev_dep.tri) {
418418
struct expr *e;
419419
e = expr_simplify_unmet_dep(sym->rev_dep.expr,
420420
sym->dir_dep.expr);

0 commit comments

Comments
 (0)