[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210719202844.18281-1-rrichter@amd.com>
Date: Mon, 19 Jul 2021 22:28:44 +0200
From: Robert Richter <rrichter@....com>
To: Masahiro Yamada <masahiroy@...nel.org>,
Michal Marek <michal.lkml@...kovi.net>,
Jonathan Corbet <corbet@....net>
Cc: Robert Richter <rrichter@....com>, linux-kbuild@...r.kernel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v3] Documentation/kbuild: Document the kconfig choice default value
Document how choice defaults are determined:
Default of a choice is its first visible choice element unless it is
explicitly set by the 'default' property [1]. Choice elements do not
support default attributes. [2]
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/kconfig/symbol.c?h=v5.14-rc1#n245
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/kconfig/menu.c?h=v5.14-rc1#n494
Signed-off-by: Robert Richter <rrichter@....com>
---
v3: Fix base of v2 (rebased onto v5.14-rc2)
v2: clarification on 'default' attribute of a choice
added example
---
Documentation/kbuild/kconfig-language.rst | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/Documentation/kbuild/kconfig-language.rst b/Documentation/kbuild/kconfig-language.rst
index 98c24183d8c3..d919dde0bcbf 100644
--- a/Documentation/kbuild/kconfig-language.rst
+++ b/Documentation/kbuild/kconfig-language.rst
@@ -417,6 +417,21 @@ definitions of that choice. If a [symbol] is associated to the choice,
then you may define the same choice (i.e. with the same entries) in another
place.
+The default value of a choice is set to the first visible choice
+element unless it is explicitly set by the 'default' property.
+
+Note:
+ Choice options do not support the 'default' attribute.
+
+E.g.::
+
+ choice
+ default C1
+ config C0
+ config C1
+ # no default attribute here
+ endchoice
+
comment::
"comment" <prompt>
--
2.29.2
Powered by blists - more mailing lists