From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Peter Zijlstra <peterz@infradead.org>,
Masahiro Yamada <masahiroy@kernel.org>,
mmarek@suse.cz, Mike Rapoport <rppt@kernel.org>,
Borislav Petkov <bp@alien8.de>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH] kconfig: Add implicit CONFIG_ prefix to IS_ENABLED() and co
Date: Tue, 28 Jun 2022 10:24:59 -0400 [thread overview]
Message-ID: <20220628142459.GB1723@windriver.com> (raw)
In-Reply-To: <CAK8P3a2XfzQo6emT4pXXxAjWewdP2LiAe2fOskFf-0suSmBJQQ@mail.gmail.com>
[Re: [RFC][PATCH] kconfig: Add implicit CONFIG_ prefix to IS_ENABLED() and co] On 28/06/2022 (Tue 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.
TL;DR - me too.
I confess that I do the same thing - I grep for CONFIG_FOO to find the
consumers, and "config FOO" to find the provider.
So while I can appreciate the value of removing verbosity, this will
impact workflows of average people out there.
Doing a grep for "PCI" is practically worthless. Having to grep for
both CONFIG_PCI and IS_ENABLED\(PCI will inevitably annoy people when
they realize they missed a code path needing an update because they only
searched for the former.
Paul.
--
>
> If we remove the prefix for IS_ENABLED(), the same grep fails to get
> all the results, while searching for the substring without the CONFIG_
> prefix can end up finding false-positives by finding longer strings (e.g.
> CONFIG_DEBUG_STACKOVERFLOW vs
> CONFIG_HAVE_DEBUG_STACKOVERFLOW).
>
> Arnd
next prev parent reply other threads:[~2022-06-28 14:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-28 9:56 [RFC][PATCH] kconfig: Add implicit CONFIG_ prefix to IS_ENABLED() and co Peter Zijlstra
2022-06-28 10:28 ` Mike Rapoport
2022-06-28 11:19 ` Arnd Bergmann
2022-06-28 12:01 ` Peter Zijlstra
2022-06-28 12:09 ` Masahiro Yamada
2022-06-28 12:17 ` Rasmus Villemoes
2022-06-28 14:24 ` Paul Gortmaker [this message]
2022-06-29 14:37 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220628142459.GB1723@windriver.com \
--to=paul.gortmaker@windriver.com \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=mmarek@suse.cz \
--cc=peterz@infradead.org \
--cc=rppt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.