Re: [RFC][PATCH] kconfig: Add implicit CONFIG_ prefix to IS_ENABLED() and co

Rasmus Villemoes
2022-06-28T12:17:13Z

On 28/06/2022 13.19, Arnd Bergmann wrote:
> On Tue, Jun 28, 2022 at 11:56 AM Peter Zijlstra <peterz@infradead.org> wrote:
>>
>> Since IS_ENABLED() (and friends) are clearly meant to be used on
>> CONFIG_foo symbols and IS_ENABLED(CONFIG_ is so long and almost an
>> tautology, allow the more compact usage of: IS_ENABLED(foo).
>>
>> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
>
> I'd prefer to keep the more verbose usage, mainly because it makes it easier
> to grep for a symbol. If today you do 'git grep CONFIG_PM_SLEEP', you find
> all instances in Makefile, in #ifdef and in IS_ENABLED(), though not the
> references in Kconfig language, which leave out the prefix.

Agreed.

Also, having CONFIG_ added implicitly requires updating fixdep, and that
will probably make the fixdep step somewhat more expensive - because one
would still have to find all explicit CONFIG_SOMETHING (they'd still be
used in ifdefs, and the int and string options directly in code), but in
addition also grep for IS_ENABLED, IS_BUILTIN, IS_MODULE.

Rasmus