Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4157816rdb; Thu, 14 Sep 2023 13:40:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGuEetz99cGhSyBHF4SyLY+EzxvZKsso1RDzvKQ/cqTcII+wgPc16/xuci0+/3Mao+ozAGJ X-Received: by 2002:a17:902:d2c1:b0:1bb:d586:d29a with SMTP id n1-20020a170902d2c100b001bbd586d29amr4368549plc.34.1694724006522; Thu, 14 Sep 2023 13:40:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694724006; cv=none; d=google.com; s=arc-20160816; b=hapIZFIXymIEs5s2yeO0gQQKinwFzm7DKnQjNVM7PSha4E895mTmjLI3b2Vpx1CUKz YuP9t+OFCwNnDAUCuFqQuc5YzkX+CWEuJxC8Qkp6nRjdffoWtjhdc9QQ2S8Yz0D57wRX MCWnKroazEAEGcfrQzRT2x2tkPQ2jQgu9BnmwVdrtEqaCXi7x5Ed4DKEUQoGJ/kqtlIH MRo7xshxm92mZGFDtQvHzALmJruY3wg6Wr6c7P4eeC4hu6YzSe4O8F7AoDAC0fWB557u 3VQJ/huaBwJg4qk9rPB7DSzfr7PzqamloIiSUMHo3voxINhqoWvF2jhetG76IkWBW9e3 0O1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=chH8PEi5Zxm0msdd3sQFDWExR/wh4QFQqsWKqNrTzWM=; fh=dVf8wfAJyLBnM95bqJKCcHB00MNuJN9C2QUZtOPwvas=; b=mN+qBizqjb9guk84jk31mWXQyfhlV9614HGvshGfhZ7RUbRIluWLAlszh03K+p9w8r VByq+eghOwBT1t5AdL7HCqHmW6eqosZCd3kX5u9u6HFlNNbJ4s9QRFzzhr64oQvHkt8r XFzLCWGQzj6vKZ4NAt1n1/F+tMThnI6V8y5UHKSvU1b8fFBjhsw7uBb43aU6+fPHC07U +QsXubFhpUXseOo6KvihWIDKDmnD0HHa00Zug6ZRwHKJdJttrQj38D9tLUd4Lg0hwLfi KmRGHIUUEkzY6voixWfYPVB/G8w6FSFfuyXNXo0F1wHcCxZIJRecubq+OwAiqmE9v3gn WB1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fjasle.eu header.s=mail header.b="geeh/i7s"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fjasle.eu Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id w63-20020a636242000000b0054fe4cdd1a7si2055097pgb.716.2023.09.14.13.40.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 13:40:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@fjasle.eu header.s=mail header.b="geeh/i7s"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fjasle.eu Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2F4F0806AFE5; Wed, 13 Sep 2023 12:50:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232199AbjIMTuI (ORCPT + 99 others); Wed, 13 Sep 2023 15:50:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229642AbjIMTuH (ORCPT ); Wed, 13 Sep 2023 15:50:07 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A61B3B7; Wed, 13 Sep 2023 12:50:01 -0700 (PDT) Received: from leknes.fjasle.eu ([46.142.99.40]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N4yuK-1rhSFF1ufU-010y5j; Wed, 13 Sep 2023 21:48:45 +0200 Received: by leknes.fjasle.eu (Postfix, from userid 1000) id 96B483E928; Wed, 13 Sep 2023 21:48:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fjasle.eu; s=mail; t=1694634522; bh=dNCzMB7kZKbtu0SVV6D5vezQPGOeLJzdXPIlY9nn0HY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=geeh/i7seOFMHSGVnQ+Sj/uRyKKjwcvJl5CNhOXyrSrFDp6gwJvkdktKjxdM1rF6b X7smwIJYI2wKSqnwC9zKw/vql8yLkMlXw1WEr6FhD3NTpbxsrtPqt7orN/y5DktjwA 3AEXv8Dw7URUCG3krehbxcFdeomCZq3ShPrvM4jQ= Date: Wed, 13 Sep 2023 21:48:42 +0200 From: Nicolas Schier To: Arnd Bergmann Cc: Masahiro Yamada , Jonathan Corbet , Sakari Ailus , Javier Martinez Canillas , Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Documentation: kbuild: explain handling optional dependencies Message-ID: References: <20230913113801.1901152-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qj5NqfuKdfJbnsCm" Content-Disposition: inline In-Reply-To: <20230913113801.1901152-1-arnd@kernel.org> X-Provags-ID: V03:K1:iov+urfC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NDHlDqDks4qIvEUs4Al 9ElJI9WOLEHdsKv4v3fKluIRIlVhOGO5pd5m54eM93PWxRCatw/G5fPkmAHERb7neOWPWTRnj 4iY0Iv74ZqrC+iA== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Sep 2023 12:50:17 -0700 (PDT) --qj5NqfuKdfJbnsCm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 13, 2023 at 01:37:52PM +0200 Arnd Bergmann wrote: > From: Arnd Bergmann >=20 > This problem frequently comes up in randconfig testing, with > drivers failing to link because of a dependency on an optional > feature. >=20 > The Kconfig language for this is very confusing, so try to > document it in "Kconfig hints" section. >=20 > Signed-off-by: Arnd Bergmann > --- Hi Arnd, thanks for documenting this! Three questions below: > Documentation/kbuild/kconfig-language.rst | 26 +++++++++++++++++++++++ > 1 file changed, 26 insertions(+) >=20 > diff --git a/Documentation/kbuild/kconfig-language.rst b/Documentation/kb= uild/kconfig-language.rst > index 858ed5d80defe..89dea587a469a 100644 > --- a/Documentation/kbuild/kconfig-language.rst > +++ b/Documentation/kbuild/kconfig-language.rst > @@ -573,6 +573,32 @@ above, leading to: > bool "Support for foo hardware" > depends on ARCH_FOO_VENDOR || COMPILE_TEST > =20 > +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 slighly -> slightly For better RST compliance: could you explicitly start the code block e.g. by appending '::' as in "... counterintuitive::"? > + > + config FOO > + bool "Support for foo hardware" > + depends on BAR || !BAR are you sure that this is enough? While testing, I needed to explicitly use =3Dy|=3Dn: depends on BAR=3Dy || BAR=3Dn to prevent FOO to be selectable iff BAR=3Dm. > + > +This means that there is either a dependency on BAR that disallows > +the combination of FOO=3Dy with BAR=3Dm, or BAR is completely disabled. For me, this sentence is hard to parse (but I am not a native speaker); what about something like this: This means that FOO can only be enabled, iff BAR is either built-in or completely disabled. If BAR is built as a module, FOO cannot be enabled. Kind regards, Nicolas --qj5NqfuKdfJbnsCm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEh0E3p4c3JKeBvsLGB1IKcBYmEmkFAmUCEhkACgkQB1IKcBYm EmmgJA/+Juye9CK9p1ddXxiVaMgnc0h6bNPW2duYWRcI3EvdQmVnb6RO0Obvf62D fp/lSkg4z6DIGnW3/LKEcx/3AAi6bjSF/TLgrURxUY6gHnRwgkj0NWR067iAXLkJ vXlzAOk6eNLk6NvewHxeLtsBK32lInNbHfg3hw3GpP20DY9HFevVVe/painn/a9r 9TM9XVjwdxMsWLgTvc5s7JicyDMk/PdW2ByZVFINZ7Q/86E9z1eeS5SvUszxsgX5 gZp2C8nKx90/nuT4Sif9EOMvqjRZvtXuQew8TYVh195J0Fry+zPMjcOyKOSv8Fub SRKsPg8hheICkmD3tHFxprKbRash+TgUGEo1+Vzi1p/NhASH5kzLGxKadvy+54Z/ DJWPlMr6ZSj9vUJngeyqFxvwTVnts2i9oJpRpkQs9qcpmxyg84k5IDlCZxTAnNmp 1wmAtNH/F2LfQaybnFHshNDDgK+0b6Vz6cSyj2V3godwdsB4Ecq7wqpbKdE6ioeH x78t0sWS7eeYcZmduJKxbspuAJ2KwUFZZjMPPwaFXvwNeetM8BsDwZ9Dqyv5owZI DTCagFieqmdvIg+jy8KVkAk2BoR0+STsTTFpf5wDtvXYFZIk2/0aq02moN7snAbm k23lPOWs9h/sRhXxXW+Hg5D10Jhh5zSqf1Fk0ba3SZb+nZbIT10= =N9EP -----END PGP SIGNATURE----- --qj5NqfuKdfJbnsCm--