linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Magnusson <ulfalizer@gmail.com>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Randy Dunlap <rdunlap@infradead.org>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	ap420073@gmail.com
Subject: Re: netfilter Kconfig question
Date: Mon, 26 Nov 2018 21:49:39 +0100	[thread overview]
Message-ID: <CAFkk2KRUOEC3kWt18YGOenqgNxWbinF3xs_ohb8a8rc7QpGF-A@mail.gmail.com> (raw)
In-Reply-To: <CAFkk2KSiFq16vXeCfYO8G_J5c4Kf59JeqqtRh-=g+NbjwGXAjg@mail.gmail.com>

On Mon, Nov 26, 2018 at 8:49 PM Ulf Magnusson <ulfalizer@gmail.com> wrote:
>
> On Mon, Nov 26, 2018 at 8:31 AM Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
> >
> > Hi Randy,
> >
> >
> > On Tue, Nov 20, 2018 at 5:51 AM Randy Dunlap <rdunlap@infradead.org> wrote:
> > >
> > > Hi Yamada-san,
> > >
> > > There was recently a netfilter build error in linux-next for which
> > > a patch was posted by Taehee Yoo.  The patch works (fixes the build
> > > error) but I don't see how or why.
> > >
> > > My build error report is here:
> > > https://lore.kernel.org/lkml/fa7a7824-44df-c058-dba2-ec29c5028361@infradead.org/T/#u
> > >
> > >
> > > Would you take a look at it and try to explain why the patch works?
> > >
> > > The patch's email thread begins here:
> > > https://www.spinics.net/lists/netfilter-devel/msg56985.html
> >
> >
> > I think this is a bug of Kconfig.
> >
> > I sent a patch.
> > https://patchwork.kernel.org/patch/10697637/
> >
> >
> > --
> > Best Regards
> > Masahiro Yamada
>
> I always understood this behavior as intentional.
>
> Say that a high-level arch symbol has 'select FOO_HELPERS if FOO' for
> example, where both FOO and FOO_HELPERS can be compiled as modules.
>
> The intention there is probably to make sure that FOO_HELPERS is
> available whenever FOO is (FOO_HELPERS must be >= FOO). If FOO is y,
> then FOO_HELPERS must be y. If FOO is m, then it's fine for
> FOO_HELPERS to be m (but not n), because it can be loaded as needed
> whenever FOO is.
>
> Forcing FOO_HELPERS to y would remove the possibility to compile it as
> a module. I suspect some things rely on this (and that some other
> symbols just automagically act in a reasonable way even though it
> wasn't planned).
>
> And yeah, there might be better ways to handle that particular case,
> but going for concepts. :)
>
> Cheers,
> Ulf

A random real-life example is SND_SOC_ALL_CODECS
(sound/soc/codecs/Kconfig). It has stuff like 'select SND_SOC_AK4458
if I2C', where SND_SOC_AK4458 also has a 'depends on I2C' (the 'if' on
the select is just there to avoid selecting a symbol with unsatisfied
dependencies).

If the behavior of 'select' was changed so that SND_SOC_AK4458 would
get set to y instead of m when I2C is m, then you'd be y-selecting a
symbol with m dependencies, which would generate a warning and
probably break the build, as I2C isn't compiled-in.

The behavior makes sense I think, though it can be a bit unexpected.
It makes a lot of stuff magically do the right thing.

People tend to overuse select though. :)

Cheers,
Ulf

  reply	other threads:[~2018-11-27  7:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19 20:50 netfilter Kconfig question Randy Dunlap
2018-11-26  7:30 ` Masahiro Yamada
2018-11-26 19:49   ` Ulf Magnusson
2018-11-26 20:49     ` Ulf Magnusson [this message]
2018-11-27  1:33       ` Masahiro Yamada
2018-11-27  1:32     ` Masahiro Yamada
2018-11-27  7:34       ` Ulf Magnusson
2018-11-27  7:47         ` Masahiro Yamada
2018-11-27  8:07           ` Ulf Magnusson
2018-11-27  8:21             ` Ulf Magnusson
2018-11-27  8:31               ` Masahiro Yamada
2018-11-27  9:09                 ` Ulf Magnusson
2018-11-28  1:11                   ` Masahiro Yamada

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=CAFkk2KRUOEC3kWt18YGOenqgNxWbinF3xs_ohb8a8rc7QpGF-A@mail.gmail.com \
    --to=ulfalizer@gmail.com \
    --cc=ap420073@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=yamada.masahiro@socionext.com \
    /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 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).