LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Boris Kolpackov <boris@codesynthesis.com>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Jaroslav Kysela <perex@perex.cz>,
	Kalle Valo <kvalo@codeaurora.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Luca Coelho <luciano.coelho@intel.com>,
	Mark Brown <broonie@kernel.org>,
	Peter Ujfalusi <peter.ujfalusi@gmail.com>,
	Takashi Iwai <tiwai@suse.com>,
	ALSA Development Mailing List <alsa-devel@alsa-project.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-wireless@vger.kernel.org,
	Networking <netdev@vger.kernel.org>
Subject: Re: [PATCH] kconfig: forbid symbols that end with '_MODULE'
Date: Thu, 26 Aug 2021 14:16:09 +0200	[thread overview]
Message-ID: <boris.20210826140701@codesynthesis.com> (raw)
In-Reply-To: <CAK7LNAS-NhR=94uHYcZUhRkdUEm=dYZSRbGKkB5zJJGNRw0z2A@mail.gmail.com>

Masahiro Yamada <masahiroy@kernel.org> writes:

> On Thu, Aug 26, 2021 at 12:42 AM Boris Kolpackov
> <boris@codesynthesis.com> wrote:
> >
> > Masahiro Yamada <masahiroy@kernel.org> writes:
> >
> > > Kconfig (syncconfig) generates include/generated/autoconf.h to make
> > > CONFIG options available to the pre-processor.
> > >
> > > The macros are suffixed with '_MODULE' for symbols with the value 'm'.
> > >
> > > Here is a conflict; CONFIG_FOO=m results in '#define CONFIG_FOO_MODULE 1',
> > > but CONFIG_FOO_MODULE=y also results in the same define.
> > >
> > > fixdep always assumes CONFIG_FOO_MODULE comes from CONFIG_FOO=m, so the
> > > dependency is not properly tracked for symbols that end with '_MODULE'.
> >
> > It seem to me the problem is in autoconf.h/fixdep, not in the Kconfig
> > language.
> 
> So, what is your suggestion for doing this correctly?
> (of course without breaking the compatibility
> because this is how the kernel is configured/built
> for more than 20 years)

Yes, I appreciate that fixing this properly may not be an option
due to backwards-compatibility. How about then moving the check
from the language closer to the place where it will actually be
an issue. Specifically, can the error be triggered when we are
about to write #define to autoconf.h and see that the name ends
with _MODULE?


> > I know you don't care, but I will voice my objection, for the record:
> > Kconfig is used by projects other than the Linux kernel and some of
> > them do not use the autoconf.h functionality. For such projects this
> > restriction seems arbitrary and potentially backwards-incompatible.
> 
> I am not sure what your worry is, but this check resides in
> "if (modules_sym)" conditional, so projects using Kconfig but
> not module functionality (e.g. buildroot) will not be  affected.

The Kconfig module semantics is actually general enough that a
project other than the Linux kernel could reuse it. (I've written
more on this possibility here[1]).

[1] https://build2.org/libbuild2-kconfig/doc/build2-kconfig-manual.xhtml#lang-mod

      reply	other threads:[~2021-08-26 12:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25  4:16 Masahiro Yamada
2021-08-25  9:52 ` Mark Brown
2021-08-25 11:59 ` Péter Ujfalusi
2021-08-26  2:28   ` Masahiro Yamada
2021-09-01  7:07     ` Péter Ujfalusi
2021-08-25 15:34 ` Boris Kolpackov
2021-08-26  2:24   ` Masahiro Yamada
2021-08-26 12:16     ` Boris Kolpackov [this message]

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=boris.20210826140701@codesynthesis.com \
    --to=boris@codesynthesis.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    --cc=masahiroy@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=peter.ujfalusi@gmail.com \
    --cc=tiwai@suse.com \
    --subject='Re: [PATCH] kconfig: forbid symbols that end with '\''_MODULE'\''' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).