Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4154955rdb; Thu, 14 Sep 2023 13:33:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFj4zUI0LLMC3OjasBP6FSEWKCfVb2EJ4mjl921DTPyL0pIK6kT0anDIPc/8XWZFl/xxEK4 X-Received: by 2002:a17:902:eb46:b0:1c3:2fc8:1305 with SMTP id i6-20020a170902eb4600b001c32fc81305mr6062889pli.47.1694723614982; Thu, 14 Sep 2023 13:33:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694723614; cv=none; d=google.com; s=arc-20160816; b=CEwh15xaDuIWjIIT+ks4nBsiDr280hZZIbzJFrcdwMamwMUnxExH3gJePHMkN2/x9n VAhnhecS8xqV1zlNEJQ8Zie+ibiRRKu3Fjx1fsXZX6EJxhqkboYxdUGzOyp2j1ZDFnZv qYrBbmcxz8+dE9z38grz+Y10ObS4RdoHS60d63S51+roDpm9/yIKSCiotJF8cEYfmoEy BJqZTLZFp2QMJG/tB0knOZm/ZGjSa7z99zA2BNtgswBomoeoAA/VtR6gyyBDdJ1yVUX0 UaKbzStejtCQlE1KoLum7LtzH1CSRTQBVOVBwfOGqk2rSQ+I7lgIYokyaQa6gjscj4yp y9Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=b3xpuzvbHNjxv61zz3MVlBvBWyOKTXmINDDHRQ8CTMw=; fh=pyqXZHgdY14RL/v+gWlh39CLkeK9RFK/NAn7Hqb+DGY=; b=ZNcJnXHeS9q1mSehL0O63iUqMg79XUsvge1qIe6X2qkAqt9QpXQqHWOw+9jDB9pcpX U1Euf5rAEbAzyQwg6jZEghrTJUQn0zy0J1aNua9zlG3ptlG046N0jZcu7jA+jcOyg/CE j3GJ/5xK4t3V2LmxR0I8B0z3rHCVtvqN0+u2oe+JM3K33RpjvnnAjzyzbaUb/YLnowLP B8A3t/0pPbxg7LZJQqJip8rttzf9tKCJH9Tqx8CtFHhjzVuPeJqWDRbjyycaus9uYDOe trR2wt9ybJb0+t4Jo1lY4y8+mmV5Lw4ok7bmWhz9uloW6t3DT7ucLbup4GoLdJg5t9zN LIIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=wb2p03v9; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=CvgV8kN7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id l1-20020a170902f68100b001b69de1eae1si2285452plg.620.2023.09.14.13.33.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 13:33:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=wb2p03v9; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=CvgV8kN7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 73C7280ECF9C; Thu, 14 Sep 2023 07:57:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240544AbjINO5k (ORCPT + 99 others); Thu, 14 Sep 2023 10:57:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234000AbjINO5j (ORCPT ); Thu, 14 Sep 2023 10:57:39 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A23221FC4; Thu, 14 Sep 2023 07:57:35 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id CBC0B5C0038; Thu, 14 Sep 2023 10:57:34 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Thu, 14 Sep 2023 10:57:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1694703454; x=1694789854; bh=b3 xpuzvbHNjxv61zz3MVlBvBWyOKTXmINDDHRQ8CTMw=; b=wb2p03v9aPPh87+rBv pkGpIB7l4Xml1K0FHgKkh37lUL9/v6cQcKA7g9ypZrRBXUim1zo8PCoOuULcD/N7 mwefwBlIRNY0Ja68qrRtLqR6F0QiUvUzX74exPQ6JxX7tM3hbELfw4Qg2+H6MId9 WiPIW2HoH0s0RweSnqYeUixe5yRdfuAVlveGn3I5cA1eT2qlQOeEe5xz+K3uAnIe Pql2swbl77acKsNbk+4xfethYJ6KfPE/UBxDG+Ij5VkzzWSptUBGJfE/CnCVVbm9 rstykJpUbNkGI860P2e0ZjlEPxS8e1K5bAWDrNor0w753ANyybp4TnGBW+HEToPU BB5w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1694703454; x=1694789854; bh=b3xpuzvbHNjxv 61zz3MVlBvBWyOKTXmINDDHRQ8CTMw=; b=CvgV8kN7zHzmHV/Zb83J1b/+TEPnT iEcl5uMo5f6duukYRJrUa8EL8LiY0ngC4mG8RqTkCnVBzczCWGUGzmkvxBwbHubY L5SpbFN6whqz5wrMz7Ri2fiStOraLyne4akkGVnpQWAgmhd3iGPN43uJ4ncNt2qV eZKrBidbfyXhN/lhK+i0pPVNd+LjZdbiofujB8HBi37KzM9aTwyIPtCT4Qu2cM9p IBi9gcNJ1f/POIsMs/vJG84Y2NTarlIvHp5Y5/fah9lsLQ/A7UW6F6d9g1ogby/V Bgtnjipo5T+SXTLwDeM7Y1eCYSDoiRd3VrzxtiMe5RvaxiJropQ1giQEw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudejtddgkeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 61884B60089; Thu, 14 Sep 2023 10:57:32 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-745-g95dd7bea33-fm-20230905.001-g95dd7bea Mime-Version: 1.0 Message-Id: In-Reply-To: <874jjwx44g.fsf@intel.com> References: <20230913113801.1901152-1-arnd@kernel.org> <874jjwx44g.fsf@intel.com> Date: Thu, 14 Sep 2023 16:57:12 +0200 From: "Arnd Bergmann" To: "Jani Nikula" , "Arnd Bergmann" , "Masahiro Yamada" , "Jonathan Corbet" Cc: "Sakari Ailus" , "Javier Martinez Canillas" , "Nathan Chancellor" , "Nick Desaulniers" , "Nicolas Schier" , linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Documentation: kbuild: explain handling optional dependencies Content-Type: text/plain 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 (howler.vger.email [0.0.0.0]); Thu, 14 Sep 2023 07:57:40 -0700 (PDT) On Thu, Sep 14, 2023, at 15:42, Jani Nikula wrote: > On Wed, 13 Sep 2023, Arnd Bergmann wrote: >> From: Arnd Bergmann >> >> +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 "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. Arnd