Received: by 2002:a05:7208:b08c:b0:82:bbfa:f723 with SMTP id c12csp422288rbb; Fri, 26 Apr 2024 08:05:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWbXDWTp8Ms1T7woU/VCLrYPooa3f+U+N9+0PtFHsdYPS89G3VZCIZKLtJTBQTQHwoeCVfH+1voZ2VQmlQlANJb03aRggIMRafcYTpp0A== X-Google-Smtp-Source: AGHT+IHSL6g2wnE8OoCvaxYEIJeQJs5O9BK0U/PkOHiscO/T+58NxLNCrXfCWeurMl2qCr/FxlXR X-Received: by 2002:a05:6808:1a0d:b0:3c7:493a:e6ec with SMTP id bk13-20020a0568081a0d00b003c7493ae6ecmr4382739oib.3.1714143931411; Fri, 26 Apr 2024 08:05:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714143931; cv=pass; d=google.com; s=arc-20160816; b=C6PKII2fzq1KgSOhaPvsBvCEIV762FGqI7c/E7lbfv1x0cxDGDl2u2Ibv4HHW8/Fh0 IWygRjJfLo8jRZF1/gNnXvklfkGddeAYQtmDCWCkLVQcOMSzrCUSRtpry/7vRIM8EEua kK0H1Zx6gOuSJn0XM0C6eytTXOy0HCVMp+2aNL1DXnOs0kk8mkrK2eXGnSVyB0hzudGt 96EXmGXwey/Koydq1PQEUPXIdknOvaTsrjGQTWsU1VechMQm7YJPtvOfv1D1vf5BSkHw IsKbAjyJMNMXwsX9oPmom4+tQPjGbknregysoqwztfK4h5SNtPT0LW99EUr0vLKo0eIJ rUrw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=W5QLnZW58CBfgPu78mlcjs68S4Yf8SD43/2CRtGvPwU=; fh=6cWv97eTRvjl03JuendYxZHLfmXWeGH91fGLA1YNurc=; b=jfXEbnWNuRhwWGKtN7BwpQazmF0ocV9Qyd8XhLPgy8iWrvQMhwVWLrobpu1IEh06QC LwVz/GFEZBEgfihMEGIehh7pqcQybO1yHgdMuMVqdinA6WUGGQ8qynXygHCd56ikXH9L s4RMhwYlKgpmbkeog+ltjNNH14zg4xx0l/h5kBmiDfGM2d7xRj1OCTNwlB+GxEP9Kvw5 VfUbonVULck92kNHXDgbHqGRP5Qt3eLWBd49SZS+U7C5XYBSJRiQBSH3hl6sfIVBPUi2 hNa8zS21H9wC6yEllS4JnfpVEVoVS98SCGNUgdAEQfn6b21N/daDmTeAiZ0M8KpmzmAn 1kwQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="kVmBP/U9"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-160203-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160203-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ej15-20020a0561302c0f00b007eb39aa0878si3106134uab.83.2024.04.26.08.05.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 08:05:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160203-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="kVmBP/U9"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-160203-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160203-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0590D1C232FE for ; Fri, 26 Apr 2024 15:05:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ECD5C14885D; Fri, 26 Apr 2024 15:05:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kVmBP/U9" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 11EDA1E504; Fri, 26 Apr 2024 15:05:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714143923; cv=none; b=rqyYjqk1nJ7A/dsSxseSs74OhwsNTNySKJmb5/e5MyO21RbY2Mh19whaqhaZq9VTkydmnlHu4WtKgTdBWm+R/gcFaBxVefOKr5+XPf6NnCv2b6+hY8O0meoyh0poW2fJXY9CGHVrVoQudnyBS8Fel6aI92x3tb2VDlDtn7t423s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714143923; c=relaxed/simple; bh=VejedOxxTo7QSOwkYVcTq4fFLRSVBP4jvU07o8BqGVo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=hkRRpYCuNKxtW0jPPoImLwOLIxu3pMuWWnB6jW/6Vej/mmtmO2GW3eTaU8uRjKDKN32x0aEXXn3OKKvfuWu9mnKv6Q/+bvHnWkYIJQlHNLfN862eM658viXUFz4ZwikP0gqR5TA6VQB/kQvSjH4jiea6WtcSu45/gspivjfDqU8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kVmBP/U9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0255C116B1; Fri, 26 Apr 2024 15:05:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714143922; bh=VejedOxxTo7QSOwkYVcTq4fFLRSVBP4jvU07o8BqGVo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=kVmBP/U9zTjk7ZGAWwchly/CbJLojEbhBmLwnVS5su6PkDG7P3c8fgPg6x/GV7wve U1+ezjbNthqGm1NRtnXKcZ5V3Xpz1HYmF9lSqa1a201TI2HD3WUaKy4hE0bL6vB7lD 1lJsYgyrlzV0Cq3g0USYrFpEa2aHdnIGroZ9t+MGok2Xf0P9J1O1wYONnsCT7NVY53 SBHb6zsc2WgojN+6OCDrbjPJsS4EvWEDUJ4eODu/doitvnUW822tpaQxAf8wRx8Uec UhfqZkzggFwAZhFOI7laTnu3FjK5JlUmIPfIRZfE2A8NC9BuVNUfyozqoi8MMNL/nb SRfhYTrb1q33w== Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-5171a529224so2774958e87.0; Fri, 26 Apr 2024 08:05:22 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCVpe4YsK5hOzpF6AU1Pu2PGkSjHwtUzXVBPlopDsxOPrzCZHi8Bt5sOhf1K2lgPaX5RJKM7ulppWzrVXvt+gnHUUxvskzWy0jRfDwH7fibr3gNR3UIP9fNvdURMvhrnKEROEeJ39pgesZGHPIeW6QyRkDZK7dnW1FTFbyqNmWwfBRE= X-Gm-Message-State: AOJu0Ywi/Xs+A2xnRDdpOISY7RQAW/O4SjK3G+v/HaVpDAm5TVBPumBt jVIh62IoGaWvwdT26b/tfPh38OPj+zPUHGnPg/brGXIpTZ0bgCcBkvHpt/BGVoLNWIPYlj0CPEY 6LSYvrT9zasNEEvAed/A3H2qtg8c= X-Received: by 2002:ac2:5f07:0:b0:51a:9f4b:1fd7 with SMTP id 7-20020ac25f07000000b0051a9f4b1fd7mr1746848lfq.58.1714143921496; Fri, 26 Apr 2024 08:05:21 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240422164104.2869507-1-masahiroy@kernel.org> <20240422164104.2869507-3-masahiroy@kernel.org> In-Reply-To: From: Masahiro Yamada Date: Sat, 27 Apr 2024 00:04:44 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] kconfig: remove 'optional' property support To: Nicolas Schier 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Apr 24, 2024 at 9:24=E2=80=AFPM Nicolas Schier wr= ote: > > 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=3Dn 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/t= ests/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 value= s 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. > """ Thanks. I will fold this. > > 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@k= ernel.org/ --=20 Best Regards Masahiro Yamada