aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-01-14 04:56:20 -0500
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-01-21 10:49:32 -0500
commit3e41ba05b6d60cd54e64639b308be62c12308a04 (patch)
tree9c99091340bd13b1a2b57077581598e8bbffe6a6 /scripts
parenteea199b445f64c038b1d868bd52700510843ccd6 (diff)
kconfig: Document SYMBOL_OPTIONAL logic
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> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/menu.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 47bec3434fef..7634d567e779 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -549,6 +549,15 @@ void menu_finalize(struct menu *parent)
549 sym->flags |= SYMBOL_WARNED; 549 sym->flags |= SYMBOL_WARNED;
550 } 550 }
551 551
552 /*
553 * For non-optional choices, add a reverse dependency (corresponding to
554 * a select) of '<visibility> && m'. This prevents the user from
555 * setting the choice mode to 'n' when the choice is visible.
556 *
557 * This would also work for non-choice symbols, but only non-optional
558 * choices clear SYMBOL_OPTIONAL as of writing. Choices are implemented
559 * as a type of symbol.
560 */
552 if (sym && !sym_is_optional(sym) && parent->prompt) { 561 if (sym && !sym_is_optional(sym) && parent->prompt) {
553 sym->rev_dep.expr = expr_alloc_or(sym->rev_dep.expr, 562 sym->rev_dep.expr = expr_alloc_or(sym->rev_dep.expr,
554 expr_alloc_and(parent->prompt->visible.expr, 563 expr_alloc_and(parent->prompt->visible.expr,