linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kconfig: Document SYMBOL_OPTIONAL logic
@ 2018-01-14  9:56 Ulf Magnusson
  2018-01-18 13:50 ` Masahiro Yamada
  0 siblings, 1 reply; 2+ messages in thread
From: Ulf Magnusson @ 2018-01-14  9:56 UTC (permalink / raw)
  To: linux-kbuild; +Cc: yamada.masahiro, sam, linux-kernel, Ulf Magnusson

Not obvious, especially if you don't already know how choices are
implemented.

No functional changes. Only comments added.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
 scripts/kconfig/menu.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 92d3f06cd8a2..372eb5d9fef3 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -548,6 +548,15 @@ void menu_finalize(struct menu *parent)
 		sym->flags |= SYMBOL_WARNED;
 	}
 
+	/*
+	 * For non-optional choices, add a reverse dependency (corresponding to
+	 * a select) of '<visibility> && m'. This prevents the user from
+	 * setting the choice mode to 'n' when the choice is visible.
+	 *
+	 * This would also work for non-choice symbols, but only non-optional
+	 * choices clear SYMBOL_OPTIONAL as of writing. Choices are implemented
+	 * as a type of symbol.
+	 */
 	if (sym && !sym_is_optional(sym) && parent->prompt) {
 		sym->rev_dep.expr = expr_alloc_or(sym->rev_dep.expr,
 				expr_alloc_and(parent->prompt->visible.expr,
-- 
2.14.1

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

* Re: [PATCH] kconfig: Document SYMBOL_OPTIONAL logic
  2018-01-14  9:56 [PATCH] kconfig: Document SYMBOL_OPTIONAL logic Ulf Magnusson
@ 2018-01-18 13:50 ` Masahiro Yamada
  0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2018-01-18 13:50 UTC (permalink / raw)
  To: Ulf Magnusson
  Cc: Linux Kbuild mailing list, Sam Ravnborg, Linux Kernel Mailing List

2018-01-14 18:56 GMT+09:00 Ulf Magnusson <ulfalizer@gmail.com>:
> Not obvious, especially if you don't already know how choices are
> implemented.
>
> No functional changes. Only comments added.
>
> Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
> ---
>  scripts/kconfig/menu.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
> index 92d3f06cd8a2..372eb5d9fef3 100644
> --- a/scripts/kconfig/menu.c
> +++ b/scripts/kconfig/menu.c
> @@ -548,6 +548,15 @@ void menu_finalize(struct menu *parent)
>                 sym->flags |= SYMBOL_WARNED;
>         }
>
> +       /*
> +        * For non-optional choices, add a reverse dependency (corresponding to
> +        * a select) of '<visibility> && m'. This prevents the user from
> +        * setting the choice mode to 'n' when the choice is visible.
> +        *
> +        * This would also work for non-choice symbols, but only non-optional
> +        * choices clear SYMBOL_OPTIONAL as of writing. Choices are implemented
> +        * as a type of symbol.
> +        */
>         if (sym && !sym_is_optional(sym) && parent->prompt) {
>                 sym->rev_dep.expr = expr_alloc_or(sym->rev_dep.expr,
>                                 expr_alloc_and(parent->prompt->visible.expr,
> --


Applied to linux-kbuild/kconfig.  Thanks!



-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2018-01-18 13:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-14  9:56 [PATCH] kconfig: Document SYMBOL_OPTIONAL logic Ulf Magnusson
2018-01-18 13:50 ` Masahiro Yamada

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).