Re: [RFC PATCH 1/2] Kconfig: Introduce "uses" keyword
From: Jason Gunthorpe
Date: Mon Apr 20 2020 - 09:53:19 EST
On Sun, Apr 19, 2020 at 04:00:43AM +0900, Masahiro Yamada wrote:
> People would wonder, "what 'uses FOO' means?",
> then they would find the explanation in kconfig-language.rst:
>
> "Equivalent to: depends on symbol || !symbol
> Semantically it means, if FOO is enabled (y/m) and has the option:
> uses BAR, make sure it can reach/use BAR when possible."
>
> To understand this correctly, people must study
> the arithmetic of (symbol || !symbol) anyway.
I think people will just cargo-cult copy it and not think too hard
about how kconfig works.
The descriptions in kconfig-language.rst can be improved to better
guide C people using kconfig without entirely understanding
it. Something like:
BAR depends on FOO // BAR selects FOO: BAR requires functionality from
FOO
BAR uses FOO: BAR optionally consumes functionality from FOO using
IS_ENABLED
BAR implies FOO: BAR optionally consumes functionality from FOO using
IS_REACHABLE
Now someone adding IS_ENABLED or IS_REACHABLE checks to C code knows
exactly what to put in the kconfig.
Jason