From: Ulf Magnusson <ulfalizer@gmail.com>
To: linux-kbuild@vger.kernel.org
Cc: yamada.masahiro@socionext.com, sam@ravnborg.org,
linux-kernel@vger.kernel.org, Ulf Magnusson <ulfalizer@gmail.com>
Subject: [PATCH] kconfig: Document SYMBOL_OPTIONAL logic
Date: Sun, 14 Jan 2018 10:56:20 +0100 [thread overview]
Message-ID: <20180114095620.12088-1-ulfalizer@gmail.com> (raw)
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>
---
| 9 +++++++++
1 file changed, 9 insertions(+)
--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
next reply other threads:[~2018-01-14 9:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-14 9:56 Ulf Magnusson [this message]
2018-01-18 13:50 ` [PATCH] kconfig: Document SYMBOL_OPTIONAL logic Masahiro Yamada
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=20180114095620.12088-1-ulfalizer@gmail.com \
--to=ulfalizer@gmail.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=yamada.masahiro@socionext.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 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).