Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp380761lqd; Wed, 24 Apr 2024 05:31:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWX3yXv7IG90timUHy8arORFNYYP6Vx0E+t+TQulxjMvwxiPfY5kKZw1ckVieMs08Vu+fLW6raOxUz/rBb2ukdvb+vR4YiPhiTVDqEZ4A== X-Google-Smtp-Source: AGHT+IED3h3rsaC1Mya9iJ0bMyjZY7Ji1ZMVLHn5SrW3/eVP8d6v3Vb0haZ1gvZ0NajZRb+Oa8cj X-Received: by 2002:a17:902:784f:b0:1e3:e380:8724 with SMTP id e15-20020a170902784f00b001e3e3808724mr2109210pln.48.1713961895293; Wed, 24 Apr 2024 05:31:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713961895; cv=pass; d=google.com; s=arc-20160816; b=eYo0CrqFTBjPWdsbU39yqTBoKg4Xb3mRQpUII9FqSxWAeSLh476i9wc5c8JlHazznV +NNZ46qA1GKx/NlhWNV2gC4I2zZs/9pD53Px8S34ybsF/6CM/xg6YO1+hYuU2XZvLgjQ tMBHXcZ0pOE7CEvYhD9Rm4IPfqFhxls6ykL0wvoO5OQ0ndken2p3j8Fo1gcbII9MiMJT 2581SgAmjBQ+qhooSCdggswxatvMhTdj/1mnCZTNQUM7vlOWRz9bX83FZGD0zHv+tx/z /cDCBCLrnPxh2097UOfSgMTt9zm+u7X5F80IX1k8Ei+J+gGeMuvqrhLA9Q/UC8NoNcs5 oHlw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6R5xNc46UcO3q9nGXYglCi+ZCDXX0orCYysiWl8SEto=; fh=iGc8M0fPs1rwMbAKfy+1ot8MUaKa1A4Er6hAY394zI0=; b=r+ng40jwLUuiggRc0MiC1i2rikCYvhTD1XkrYeqGzba8DYcAP48MF6bf/H0ZoYOCSp WpnJGVpp18dlh4FS85iolC9k523fdl82/New4LaJAYETfOB7Jjtu5ADV4FvOG4wQbtap kgT5+Blt2eLY5JsmX9O2LWwTBYc+rWfSTkRDWovlXNOmnYTIjritTqaBu74NDIqVzz5n /k25iRnfgPcNzy1i5/Se5JuZphYVq5Zy/Tm/inbtlEcDvQZdnDPDuvl+wjNsBeW7qzap o3ZITObhAN0FsddhZGQBdpFXK9rlJJvq0FEMs3I5rFnBomiAvKTnpPy743/mvYEOHvI/ zDNg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@avm.de header.s=mail header.b=sKyi2idq; arc=pass (i=1 spf=pass spfdomain=avm.de dkim=pass dkdomain=avm.de dmarc=pass fromdomain=avm.de); spf=pass (google.com: domain of linux-kernel+bounces-156861-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156861-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=avm.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id u1-20020a170902e80100b001e7a28b6726si11326507plg.628.2024.04.24.05.31.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 05:31:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-156861-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@avm.de header.s=mail header.b=sKyi2idq; arc=pass (i=1 spf=pass spfdomain=avm.de dkim=pass dkdomain=avm.de dmarc=pass fromdomain=avm.de); spf=pass (google.com: domain of linux-kernel+bounces-156861-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156861-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=avm.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 114FFB24EDB for ; Wed, 24 Apr 2024 12:25:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A9C115B136; Wed, 24 Apr 2024 12:24:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=avm.de header.i=@avm.de header.b="sKyi2idq" Received: from mail.avm.de (mail.avm.de [212.42.244.94]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49FE915ADAD; Wed, 24 Apr 2024 12:24:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.42.244.94 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713961470; cv=none; b=HgqLL3BiTVgG2FGDg4TCJahQazNn9D6gCKhFvaKXwlFcuxiwP3KphkU3HYIKlBsfN2/tQ+7m9y0WtIwCEzDEc6FjvZgBaHoH1vTGJ2ETQQAsxKztj7zp7MCwLS3pz+XSqznVGyHv9LSTlYurydiKtBebVXABUHPg/5wDNzwx6LM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713961470; c=relaxed/simple; bh=bfQI4Yq0CyiT7iayneJPtPZ0mu3Owe3QmD6Ot4PZCd4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=d1LAI6oBGmkB1bzh5qTozZo1yCPFTzwoPj5jjMteLWw3dpEWmPdjpa5XUQFaNEqyw5S2XOLMjY6j/aRxFguqLbFE0s6PRUSTLfP0QNDsfqLYsf53xfuNDYXXns3FpXXADzjN3dtUnsOc+5j6i9d3N8qn78kPA/Kj3AhcICVRlDc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=avm.de; spf=pass smtp.mailfrom=avm.de; dkim=pass (1024-bit key) header.d=avm.de header.i=@avm.de header.b=sKyi2idq; arc=none smtp.client-ip=212.42.244.94 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=avm.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=avm.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=avm.de; s=mail; t=1713961443; bh=bfQI4Yq0CyiT7iayneJPtPZ0mu3Owe3QmD6Ot4PZCd4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sKyi2idqZcDH+tgmc9hbaskD5ctWLBkt7vnl7pbMPq181SHLSEWfh50lFb3m8bv0I hPcJ7413r8l6dYZa2TLhNcZPF4620HYDJbVClbs9OOZgYum7QfQUV6cSw3Yu9Ou85t v8VF7LBwTbiJDLW4PVyFumgdxgFdnRyOUESnTDco= Received: from mail-auth.avm.de (dovecot-mx-01.avm.de [212.42.244.71]) by mail.avm.de (Postfix) with ESMTPS; Wed, 24 Apr 2024 14:24:03 +0200 (CEST) Received: from buildd.core.avm.de (buildd-sv-01.avm.de [172.16.0.225]) by mail-auth.avm.de (Postfix) with ESMTPA id 1BD9780472; Wed, 24 Apr 2024 14:24:03 +0200 (CEST) Received: by buildd.core.avm.de (Postfix, from userid 1000) id 101DA18334E; Wed, 24 Apr 2024 14:24:03 +0200 (CEST) Date: Wed, 24 Apr 2024 14:24:03 +0200 From: Nicolas Schier To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , linux-sh@vger.kernel.org, Jonathan Corbet , Nathan Chancellor , linux-doc@vger.kernel.org Subject: Re: [PATCH v2 2/2] kconfig: remove 'optional' property support Message-ID: References: <20240422164104.2869507-1-masahiroy@kernel.org> <20240422164104.2869507-3-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240422164104.2869507-3-masahiroy@kernel.org> X-purgate-ID: 149429::1713961443-BD53ED52-146531E8/0/0 X-purgate-type: clean X-purgate-size: 2753 X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean On Tue, Apr 23, 2024 at 01:41:04AM +0900, Masahiro Yamada wrote: > The 'choice' statement is primarily used to exclusively select one > option, but the 'optional' property allows all entries to be disabled. > > In the following example, both A and B can be disabled simultaneously: > > choice > prompt "choose A, B, or nothing" > optional > > config A > bool "A" > > config B > bool "B" > > endchoice > > You can achieve the equivalent outcome by other means. > > A common solution is to add another option to guard the choice block. > In the following example, you can set ENABLE_A_B_CHOICE=n to disable > the entire choice block: > > choice > prompt "choose A or B" > depends on ENABLE_A_B_CHOICE > > config A > bool "A" > > config B > bool "B" > > endchoice > > Another approach is to insert one more entry as a place-holder: > > choice > prompt "choose A, B, or disable both" > > config A > bool "A" > > config B > bool "B" > > config DISABLE_A_AND_B > bool "choose this to disable both A and B" > > endchoice > > Some real examples are DEBUG_INFO_NONE, INITRAMFS_COMPRESSION_NONE, > LTO_NONE, etc. > > The 'optional' property is even more unnecessary for a tristate choice. > > Without the 'optional' property, you can disable A and B; you can set > 'm' in the choice prompt, and disable A and B individually: > > choice > prompt "choose one built-in or make them modular" > > config A > tristate "A" > > config B > tristate "B" > > endchoice > > In conclusion, the 'optional' property was unneeded. > > Signed-off-by: Masahiro Yamada > --- > > (no changes since v1) thanks for the patch! I found just one small remnant that probably should be removed as well: diff --git a/scripts/kconfig/tests/choice/__init__.py b/scripts/kconfig/tests/choice/__init__.py index 4318fce05912f..05e162220085c 100644 --- a/scripts/kconfig/tests/choice/__init__.py +++ b/scripts/kconfig/tests/choice/__init__.py @@ -8,4 +8,2 @@ The behavior of 'y' choice is intuitive. If choice values are tristate, the choice can be 'm' where each value can be enabled independently. -Also, if a choice is marked as 'optional', the whole choice can be -invisible. """ Reviewed-by: Nicolas Schier Kind regards, Nicolas PS: For other reviewers, this patch (set) depends on https://lore.kernel.org/linux-kbuild/20240422161054.2867285-1-masahiroy@kernel.org/