All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Robert Richter <rrichter@amd.com>
Cc: Michal Marek <michal.lkml@markovi.net>,
	Jonathan Corbet <corbet@lwn.net>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] Documentation/kbuild: Document the kconfig choice default value
Date: Thu, 5 Aug 2021 21:47:18 +0900	[thread overview]
Message-ID: <CAK7LNARtAv7Vybjk61_MffQhQj2HSZzAGtdCxr83ODPtk+1OaQ@mail.gmail.com> (raw)
In-Reply-To: <20210719202844.18281-1-rrichter@amd.com>

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

  reply	other threads:[~2021-08-05 12:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2021-07-16 17:29 ` [PATCH] ACPI: Kconfig: Fix table override from built-in initrd Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAK7LNARtAv7Vybjk61_MffQhQj2HSZzAGtdCxr83ODPtk+1OaQ@mail.gmail.com \
    --to=masahiroy@kernel.org \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=rrichter@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.