[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87v8ccvjd1.fsf@intel.com>
Date: Thu, 14 Sep 2023 18:56:42 +0300
From: Jani Nikula <jani.nikula@...ux.intel.com>
To: Arnd Bergmann <arnd@...db.de>, Arnd Bergmann <arnd@...nel.org>,
Masahiro Yamada <masahiroy@...nel.org>,
Jonathan Corbet <corbet@....net>
Cc: Sakari Ailus <sakari.ailus@....fi>,
Javier Martinez Canillas <javierm@...hat.com>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Nicolas Schier <nicolas@...sle.eu>,
linux-kbuild@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Documentation: kbuild: explain handling optional
dependencies
On Thu, 14 Sep 2023, "Arnd Bergmann" <arnd@...db.de> wrote:
> On Thu, Sep 14, 2023, at 15:42, Jani Nikula wrote:
>> On Wed, 13 Sep 2023, Arnd Bergmann <arnd@...nel.org> wrote:
>>> From: Arnd Bergmann <arnd@...db.de>
>>>
>>> +Optional dependencies
>>> +~~~~~~~~~~~~~~~~~~~~~
>>> +
>>> +Some drivers are able to optionally use a feature from another module
>>> +or build cleanly with that module disabled, but cause a link failure
>>> +when trying to use that loadable module from a built-in driver.
>>> +
>>> +The most common way to express this optional dependency in Kconfig logic
>>> +uses the slighly counterintuitive
>>> +
>>> + config FOO
>>> + bool "Support for foo hardware"
>>> + depends on BAR || !BAR
>>
>> depends on BAR || BAR=n
>>
>> seems to be an alternative that's about as common:
>>
>> $ git grep "depends on \([A-Z0-9_]\+\) || \!\1" | wc -l
>> 109
>> $ git grep "depends on \([A-Z0-9_]\+\) || \1=n" | wc -l
>> 107
>>
>> Maybe worth mentioning both?
>
> I fear that would add more confusion than it avoids:
> "!BAR" is actually different from "BAR=n", but
*head explodes*
> "BAR || !BAR" is the same as "BAR || BAR=n" here, and
> trying to explain this in the documentation would either
> make it incorrect or unhelpfully complicated.
Fair enough.
BR,
Jani.
--
Jani Nikula, Intel
Powered by blists - more mailing lists