linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI: Kconfig: Fix table override from built-in initrd
@ 2021-07-15  9:26 Robert Richter
  2021-07-15  9:26 ` [PATCH] Documentation: Fix intiramfs script name Robert Richter
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Robert Richter @ 2021-07-15  9:26 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Masahiro Yamada
  Cc: Robert Richter, linux-acpi, linux-kernel

During a rework of initramfs code the INITRAMFS_COMPRESSION config
option was removed in commit 65e00e04e5ae. A leftover as a dependency
broke the config option ACPI_TABLE_OVERRIDE_VIA_ BUILTIN_INITRD that
is used to enable the overriding of ACPI tables from built-in initrd.
Fixing the dependency.

Fixes: 65e00e04e5ae ("initramfs: refactor the initramfs build rules")
Signed-off-by: Robert Richter <rrichter@amd.com>
---
 drivers/acpi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 9d872ea477a6..8f9940f40baa 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -370,7 +370,7 @@ config ACPI_TABLE_UPGRADE
 config ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD
 	bool "Override ACPI tables from built-in initrd"
 	depends on ACPI_TABLE_UPGRADE
-	depends on INITRAMFS_SOURCE!="" && INITRAMFS_COMPRESSION=""
+	depends on INITRAMFS_SOURCE!="" && INITRAMFS_COMPRESSION_NONE
 	help
 	  This option provides functionality to override arbitrary ACPI tables
 	  from built-in uncompressed initrd.
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] Documentation: Fix intiramfs script name
  2021-07-15  9:26 [PATCH] ACPI: Kconfig: Fix table override from built-in initrd Robert Richter
@ 2021-07-15  9:26 ` Robert Richter
  2021-07-18 13:58   ` Masahiro Yamada
  2021-07-15  9:26 ` [PATCH] Documentation/kbuild: Document the kconfig choice default value Robert Richter
  2021-07-16 17:29 ` [PATCH] ACPI: Kconfig: Fix table override from built-in initrd Rafael J. Wysocki
  2 siblings, 1 reply; 10+ messages in thread
From: Robert Richter @ 2021-07-15  9:26 UTC (permalink / raw)
  To: Jonathan Corbet, Masahiro Yamada; +Cc: Robert Richter, linux-doc, linux-kernel

Documentation was not changed when renaming the script in commit
80e715a06c2d ("initramfs: rename gen_initramfs_list.sh to
gen_initramfs.sh"). Fixing this.

Basically does:

 $ sed -i -e s/gen_initramfs_list.sh/gen_initramfs.sh/g $(git grep -l gen_initramfs_list.sh)

Fixes: 80e715a06c2d ("initramfs: rename gen_initramfs_list.sh to gen_initramfs.sh")
Signed-off-by: Robert Richter <rrichter@amd.com>
---
 .../early-userspace/early_userspace_support.rst           | 8 ++++----
 Documentation/filesystems/ramfs-rootfs-initramfs.rst      | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/driver-api/early-userspace/early_userspace_support.rst b/Documentation/driver-api/early-userspace/early_userspace_support.rst
index 8a58c61932ff..61bdeac1bae5 100644
--- a/Documentation/driver-api/early-userspace/early_userspace_support.rst
+++ b/Documentation/driver-api/early-userspace/early_userspace_support.rst
@@ -69,17 +69,17 @@ early userspace image can be built by an unprivileged user.
 
 As a technical note, when directories and files are specified, the
 entire CONFIG_INITRAMFS_SOURCE is passed to
-usr/gen_initramfs_list.sh.  This means that CONFIG_INITRAMFS_SOURCE
+usr/gen_initramfs.sh.  This means that CONFIG_INITRAMFS_SOURCE
 can really be interpreted as any legal argument to
-gen_initramfs_list.sh.  If a directory is specified as an argument then
+gen_initramfs.sh.  If a directory is specified as an argument then
 the contents are scanned, uid/gid translation is performed, and
 usr/gen_init_cpio file directives are output.  If a directory is
-specified as an argument to usr/gen_initramfs_list.sh then the
+specified as an argument to usr/gen_initramfs.sh then the
 contents of the file are simply copied to the output.  All of the output
 directives from directory scanning and file contents copying are
 processed by usr/gen_init_cpio.
 
-See also 'usr/gen_initramfs_list.sh -h'.
+See also 'usr/gen_initramfs.sh -h'.
 
 Where's this all leading?
 =========================
diff --git a/Documentation/filesystems/ramfs-rootfs-initramfs.rst b/Documentation/filesystems/ramfs-rootfs-initramfs.rst
index 4598b0d90b60..164960631925 100644
--- a/Documentation/filesystems/ramfs-rootfs-initramfs.rst
+++ b/Documentation/filesystems/ramfs-rootfs-initramfs.rst
@@ -170,7 +170,7 @@ Documentation/driver-api/early-userspace/early_userspace_support.rst for more de
 The kernel does not depend on external cpio tools.  If you specify a
 directory instead of a configuration file, the kernel's build infrastructure
 creates a configuration file from that directory (usr/Makefile calls
-usr/gen_initramfs_list.sh), and proceeds to package up that directory
+usr/gen_initramfs.sh), and proceeds to package up that directory
 using the config file (by feeding it to usr/gen_init_cpio, which is created
 from usr/gen_init_cpio.c).  The kernel's build-time cpio creation code is
 entirely self-contained, and the kernel's boot-time extractor is also
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] Documentation/kbuild: Document the kconfig choice default value
  2021-07-15  9:26 [PATCH] ACPI: Kconfig: Fix table override from built-in initrd Robert Richter
  2021-07-15  9:26 ` [PATCH] Documentation: Fix intiramfs script name Robert Richter
@ 2021-07-15  9:26 ` Robert Richter
  2021-07-18  9:36   ` Masahiro Yamada
  2021-07-16 17:29 ` [PATCH] ACPI: Kconfig: Fix table override from built-in initrd Rafael J. Wysocki
  2 siblings, 1 reply; 10+ messages in thread
From: Robert Richter @ 2021-07-15  9:26 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek, Jonathan Corbet
  Cc: Robert Richter, linux-kbuild, linux-doc, linux-kernel

Document how choice defaults are determined:

Default of a choice is its first visible choice element [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@amd.com>
---
 Documentation/kbuild/kconfig-language.rst | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/kbuild/kconfig-language.rst b/Documentation/kbuild/kconfig-language.rst
index 98c24183d8c3..e4d3463594e1 100644
--- a/Documentation/kbuild/kconfig-language.rst
+++ b/Documentation/kbuild/kconfig-language.rst
@@ -417,6 +417,9 @@ 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.
+Choice elements do not support the default attribute like menu entries do.
+
 comment::
 
 	"comment" <prompt>
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] ACPI: Kconfig: Fix table override from built-in initrd
  2021-07-15  9:26 [PATCH] ACPI: Kconfig: Fix table override from built-in initrd Robert Richter
  2021-07-15  9:26 ` [PATCH] Documentation: Fix intiramfs script name Robert Richter
  2021-07-15  9:26 ` [PATCH] Documentation/kbuild: Document the kconfig choice default value Robert Richter
@ 2021-07-16 17:29 ` Rafael J. Wysocki
  2 siblings, 0 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2021-07-16 17:29 UTC (permalink / raw)
  To: Robert Richter
  Cc: Rafael J. Wysocki, Len Brown, Masahiro Yamada,
	ACPI Devel Maling List, Linux Kernel Mailing List

On Thu, Jul 15, 2021 at 11:26 AM Robert Richter <rrichter@amd.com> wrote:
>
> During a rework of initramfs code the INITRAMFS_COMPRESSION config
> option was removed in commit 65e00e04e5ae. A leftover as a dependency
> broke the config option ACPI_TABLE_OVERRIDE_VIA_ BUILTIN_INITRD that
> is used to enable the overriding of ACPI tables from built-in initrd.
> Fixing the dependency.
>
> Fixes: 65e00e04e5ae ("initramfs: refactor the initramfs build rules")
> Signed-off-by: Robert Richter <rrichter@amd.com>
> ---
>  drivers/acpi/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
> index 9d872ea477a6..8f9940f40baa 100644
> --- a/drivers/acpi/Kconfig
> +++ b/drivers/acpi/Kconfig
> @@ -370,7 +370,7 @@ config ACPI_TABLE_UPGRADE
>  config ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD
>         bool "Override ACPI tables from built-in initrd"
>         depends on ACPI_TABLE_UPGRADE
> -       depends on INITRAMFS_SOURCE!="" && INITRAMFS_COMPRESSION=""
> +       depends on INITRAMFS_SOURCE!="" && INITRAMFS_COMPRESSION_NONE
>         help
>           This option provides functionality to override arbitrary ACPI tables
>           from built-in uncompressed initrd.
> --

Applied as 5.14-rc material, thanks!

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Documentation/kbuild: Document the kconfig choice default value
  2021-07-15  9:26 ` [PATCH] Documentation/kbuild: Document the kconfig choice default value Robert Richter
@ 2021-07-18  9:36   ` Masahiro Yamada
  2021-07-19  9:16     ` [PATCH v2] " Robert Richter
  0 siblings, 1 reply; 10+ messages in thread
From: Masahiro Yamada @ 2021-07-18  9:36 UTC (permalink / raw)
  To: Robert Richter
  Cc: Michal Marek, Jonathan Corbet, Linux Kbuild mailing list,
	open list:DOCUMENTATION, Linux Kernel Mailing List

On Thu, Jul 15, 2021 at 6:26 PM Robert Richter <rrichter@amd.com> wrote:
>
> Document how choice defaults are determined:
>
> Default of a choice is its first visible choice element [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@amd.com>
> ---
>  Documentation/kbuild/kconfig-language.rst | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/Documentation/kbuild/kconfig-language.rst b/Documentation/kbuild/kconfig-language.rst
> index 98c24183d8c3..e4d3463594e1 100644
> --- a/Documentation/kbuild/kconfig-language.rst
> +++ b/Documentation/kbuild/kconfig-language.rst
> @@ -417,6 +417,9 @@ 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.


The default value of a choice is set to the first visible choice element
unless it is explicitly set by the 'default' property.

... is more precise.




> +Choice elements do not support the default attribute like menu entries do.

I doubt this info is useful.
Rather, is it even confusing?


choices support 'default' but
choice elements (i.e. choice values) do not.









> +
>  comment::
>
>         "comment" <prompt>
> --
> 2.29.2
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Documentation: Fix intiramfs script name
  2021-07-15  9:26 ` [PATCH] Documentation: Fix intiramfs script name Robert Richter
@ 2021-07-18 13:58   ` Masahiro Yamada
  0 siblings, 0 replies; 10+ messages in thread
From: Masahiro Yamada @ 2021-07-18 13:58 UTC (permalink / raw)
  To: Robert Richter
  Cc: Jonathan Corbet, open list:DOCUMENTATION, Linux Kernel Mailing List

On Thu, Jul 15, 2021 at 6:26 PM Robert Richter <rrichter@amd.com> wrote:
>
> Documentation was not changed when renaming the script in commit
> 80e715a06c2d ("initramfs: rename gen_initramfs_list.sh to
> gen_initramfs.sh"). Fixing this.
>
> Basically does:
>
>  $ sed -i -e s/gen_initramfs_list.sh/gen_initramfs.sh/g $(git grep -l gen_initramfs_list.sh)
>
> Fixes: 80e715a06c2d ("initramfs: rename gen_initramfs_list.sh to gen_initramfs.sh")
> Signed-off-by: Robert Richter <rrichter@amd.com>

Applied to linux-kbuild.




> ---
>  .../early-userspace/early_userspace_support.rst           | 8 ++++----
>  Documentation/filesystems/ramfs-rootfs-initramfs.rst      | 2 +-
>  2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/driver-api/early-userspace/early_userspace_support.rst b/Documentation/driver-api/early-userspace/early_userspace_support.rst
> index 8a58c61932ff..61bdeac1bae5 100644
> --- a/Documentation/driver-api/early-userspace/early_userspace_support.rst
> +++ b/Documentation/driver-api/early-userspace/early_userspace_support.rst
> @@ -69,17 +69,17 @@ early userspace image can be built by an unprivileged user.
>
>  As a technical note, when directories and files are specified, the
>  entire CONFIG_INITRAMFS_SOURCE is passed to
> -usr/gen_initramfs_list.sh.  This means that CONFIG_INITRAMFS_SOURCE
> +usr/gen_initramfs.sh.  This means that CONFIG_INITRAMFS_SOURCE
>  can really be interpreted as any legal argument to
> -gen_initramfs_list.sh.  If a directory is specified as an argument then
> +gen_initramfs.sh.  If a directory is specified as an argument then
>  the contents are scanned, uid/gid translation is performed, and
>  usr/gen_init_cpio file directives are output.  If a directory is
> -specified as an argument to usr/gen_initramfs_list.sh then the
> +specified as an argument to usr/gen_initramfs.sh then the
>  contents of the file are simply copied to the output.  All of the output
>  directives from directory scanning and file contents copying are
>  processed by usr/gen_init_cpio.
>
> -See also 'usr/gen_initramfs_list.sh -h'.
> +See also 'usr/gen_initramfs.sh -h'.
>
>  Where's this all leading?
>  =========================
> diff --git a/Documentation/filesystems/ramfs-rootfs-initramfs.rst b/Documentation/filesystems/ramfs-rootfs-initramfs.rst
> index 4598b0d90b60..164960631925 100644
> --- a/Documentation/filesystems/ramfs-rootfs-initramfs.rst
> +++ b/Documentation/filesystems/ramfs-rootfs-initramfs.rst
> @@ -170,7 +170,7 @@ Documentation/driver-api/early-userspace/early_userspace_support.rst for more de
>  The kernel does not depend on external cpio tools.  If you specify a
>  directory instead of a configuration file, the kernel's build infrastructure
>  creates a configuration file from that directory (usr/Makefile calls
> -usr/gen_initramfs_list.sh), and proceeds to package up that directory
> +usr/gen_initramfs.sh), and proceeds to package up that directory
>  using the config file (by feeding it to usr/gen_init_cpio, which is created
>  from usr/gen_init_cpio.c).  The kernel's build-time cpio creation code is
>  entirely self-contained, and the kernel's boot-time extractor is also
> --
> 2.29.2
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2] Documentation/kbuild: Document the kconfig choice default value
  2021-07-18  9:36   ` Masahiro Yamada
@ 2021-07-19  9:16     ` Robert Richter
  2021-07-19 20:20       ` Robert Richter
  0 siblings, 1 reply; 10+ messages in thread
From: Robert Richter @ 2021-07-19  9:16 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Michal Marek, Jonathan Corbet, Linux Kbuild mailing list,
	open list:DOCUMENTATION, Linux Kernel Mailing List

On 18.07.21 18:36:31, Masahiro Yamada wrote:
> On Thu, Jul 15, 2021 at 6:26 PM Robert Richter <rrichter@amd.com> wrote:

> > --- a/Documentation/kbuild/kconfig-language.rst
> > +++ b/Documentation/kbuild/kconfig-language.rst
> > @@ -417,6 +417,9 @@ 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.
> 
> 
> The default value of a choice is set to the first visible choice element
> unless it is explicitly set by the 'default' property.
> 
> ... is more precise.

Ah, ok. It becomes clear now, but how a value is set then in case the
type is tristate?

> 
> 
> 
> 
> > +Choice elements do not support the default attribute like menu entries do.
> 
> I doubt this info is useful.
> Rather, is it even confusing?
> 
> 
> choices support 'default' but
> choice elements (i.e. choice values) do not.

I have added an example to the doc for clarification, v2 below.

Thanks,

-Robert


From 46ebd10dc11388ddce40aea70890000697a27165 Mon Sep 17 00:00:00 2001
From: Robert Richter <rrichter@amd.com>
Date: Wed, 14 Jul 2021 12:24:16 +0200
Subject: [PATCH v2] 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@amd.com>
---
v2: clarification on 'default' attribute of a choice
    added example
---
 Documentation/kbuild/kconfig-language.rst | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/Documentation/kbuild/kconfig-language.rst b/Documentation/kbuild/kconfig-language.rst
index e4d3463594e1..d919dde0bcbf 100644
--- a/Documentation/kbuild/kconfig-language.rst
+++ b/Documentation/kbuild/kconfig-language.rst
@@ -417,8 +417,20 @@ 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.
-Choice elements do not support the default attribute like menu entries do.
+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::
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] Documentation/kbuild: Document the kconfig choice default value
  2021-07-19  9:16     ` [PATCH v2] " Robert Richter
@ 2021-07-19 20:20       ` Robert Richter
  2021-07-19 20:28         ` [PATCH v3] " Robert Richter
  0 siblings, 1 reply; 10+ messages in thread
From: Robert Richter @ 2021-07-19 20:20 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Michal Marek, Jonathan Corbet, Linux Kbuild mailing list,
	open list:DOCUMENTATION, Linux Kernel Mailing List

On 19.07.21 11:16:09, Robert Richter wrote:
> @@ -417,8 +417,20 @@ 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.
> -Choice elements do not support the default attribute like menu entries do.

This patch was not properly rebased and does not apply. Will resend a v3.

Sorry for that.

-Robert

> +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::
>  
> -- 
> 2.29.2
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3] Documentation/kbuild: Document the kconfig choice default value
  2021-07-19 20:20       ` Robert Richter
@ 2021-07-19 20:28         ` Robert Richter
  2021-08-05 12:47           ` Masahiro Yamada
  0 siblings, 1 reply; 10+ messages in thread
From: Robert Richter @ 2021-07-19 20:28 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek, Jonathan Corbet
  Cc: Robert Richter, linux-kbuild, linux-doc, linux-kernel

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@amd.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


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v3] Documentation/kbuild: Document the kconfig choice default value
  2021-07-19 20:28         ` [PATCH v3] " Robert Richter
@ 2021-08-05 12:47           ` Masahiro Yamada
  0 siblings, 0 replies; 10+ messages in thread
From: Masahiro Yamada @ 2021-08-05 12:47 UTC (permalink / raw)
  To: Robert Richter
  Cc: Michal Marek, Jonathan Corbet, Linux Kbuild mailing list,
	open list:DOCUMENTATION, Linux Kernel Mailing List

On Tue, Jul 20, 2021 at 5:29 AM Robert Richter <rrichter@amd.com> wrote:
>
> 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@amd.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
>


I am not sure whether this note is needed or not,
anyway the code example is wrong.

Kconfig:3:warning: config symbol defined without type
Kconfig:4:warning: config symbol defined without type
Kconfig:3:warning: choice value must have a prompt
Kconfig:4:warning: choice value must have a prompt
Kconfig:1:warning: config symbol defined without type
Kconfig:1:warning: choice must have a prompt







-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-08-05 12:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15  9:26 [PATCH] ACPI: Kconfig: Fix table override from built-in initrd Robert Richter
2021-07-15  9:26 ` [PATCH] Documentation: Fix intiramfs script name Robert Richter
2021-07-18 13:58   ` Masahiro Yamada
2021-07-15  9:26 ` [PATCH] Documentation/kbuild: Document the kconfig choice default value Robert Richter
2021-07-18  9:36   ` Masahiro Yamada
2021-07-19  9:16     ` [PATCH v2] " Robert Richter
2021-07-19 20:20       ` Robert Richter
2021-07-19 20:28         ` [PATCH v3] " Robert Richter
2021-08-05 12:47           ` Masahiro Yamada
2021-07-16 17:29 ` [PATCH] ACPI: Kconfig: Fix table override from built-in initrd Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).