Re: [PATCH 2/2] kconfig: make 'imply' obey the direct dependency

From: Geert Uytterhoeven
Date: Fri Mar 06 2020 - 07:17:28 EST


Hi Yamada-san,

On Mon, Mar 2, 2020 at 7:24 AM Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:
> The 'imply' statement may create unmet direct dependency when the
> implied symbol depends on m.
>
> [Test Code]
>
> config FOO
> tristate "foo"
> imply BAZ
>
> config BAZ
> tristate "baz"
> depends on BAR
>
> config BAR
> def_tristate m
>
> config MODULES
> def_bool y
> option modules
>
> If you set FOO=y, BAZ is also promoted to y, which results in the
> following .config file:
>
> CONFIG_FOO=y
> CONFIG_BAZ=y
> CONFIG_BAR=m
> CONFIG_MODULES=y
>
> This does not meet the dependency 'BAZ depends on BAR'.
>
> Unlike 'select', what is worse, Kconfig never shows the
> 'WARNING: unmet direct dependencies detected for ...' for this case.
>
> Because 'imply' is considered to be weaker than 'depends on', Kconfig
> should take the direct dependency into account.
>
> For clarification, describe this case in kconfig-language.rst too.
>
> Signed-off-by: Masahiro Yamada <masahiroy@xxxxxxxxxx>

This fixes some issue with "imply SND_SOC_WCD934X".
Tested-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>

Gr{oetje,eeting}s,

Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds