Commit f429d355 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild

Pull kconfig update from Michal Marek:

 - fix for behavior of tristate choice items and fix for documentation
   of existing kconfig behavior [Dirk Gouders]

 - more helpful "unexpected data" kconfig warning [Paul Bolle]

* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kconfig/symbol.c: handle choice_values that depend on 'm' symbols
  kconfig-language: elaborate on the type of a choice
  kconfig-language: fix comment on dependency-generated menu structures.
  kconfig: add unexpected data itself to warning
parents 5b26fc88 fa64e5f6
...@@ -241,9 +241,8 @@ comment "module support disabled" ...@@ -241,9 +241,8 @@ comment "module support disabled"
depends on !MODULES depends on !MODULES
MODVERSIONS directly depends on MODULES, this means it's only visible if MODVERSIONS directly depends on MODULES, this means it's only visible if
MODULES is different from 'n'. The comment on the other hand is always MODULES is different from 'n'. The comment on the other hand is only
visible when MODULES is visible (the (empty) dependency of MODULES is visible when MODULES is set to 'n'.
also part of the comment dependencies).
Kconfig syntax Kconfig syntax
...@@ -285,12 +284,17 @@ choices: ...@@ -285,12 +284,17 @@ choices:
"endchoice" "endchoice"
This defines a choice group and accepts any of the above attributes as This defines a choice group and accepts any of the above attributes as
options. A choice can only be of type bool or tristate, while a boolean options. A choice can only be of type bool or tristate. If no type is
choice only allows a single config entry to be selected, a tristate specified for a choice, it's type will be determined by the type of
choice also allows any number of config entries to be set to 'm'. This the first choice element in the group or remain unknown if none of the
can be used if multiple drivers for a single hardware exists and only a choice elements have a type specified, as well.
single driver can be compiled/loaded into the kernel, but all drivers
can be compiled as modules. While a boolean choice only allows a single config entry to be
selected, a tristate choice also allows any number of config entries
to be set to 'm'. This can be used if multiple drivers for a single
hardware exists and only a single driver can be compiled/loaded into
the kernel, but all drivers can be compiled as modules.
A choice accepts another option "optional", which allows to set the A choice accepts another option "optional", which allows to set the
choice to 'n' and no entry needs to be selected. choice to 'n' and no entry needs to be selected.
If no [symbol] is associated with a choice, then you can not have multiple If no [symbol] is associated with a choice, then you can not have multiple
......
...@@ -375,7 +375,9 @@ int conf_read_simple(const char *name, int def) ...@@ -375,7 +375,9 @@ int conf_read_simple(const char *name, int def)
continue; continue;
} else { } else {
if (line[0] != '\r' && line[0] != '\n') if (line[0] != '\r' && line[0] != '\n')
conf_warning("unexpected data"); conf_warning("unexpected data: %.*s",
(int)strcspn(line, "\r\n"), line);
continue; continue;
} }
setsym: setsym:
......
...@@ -209,12 +209,26 @@ static void sym_set_all_changed(void) ...@@ -209,12 +209,26 @@ static void sym_set_all_changed(void)
static void sym_calc_visibility(struct symbol *sym) static void sym_calc_visibility(struct symbol *sym)
{ {
struct property *prop; struct property *prop;
struct symbol *choice_sym = NULL;
tristate tri; tristate tri;
/* any prompt visible? */ /* any prompt visible? */
tri = no; tri = no;
if (sym_is_choice_value(sym))
choice_sym = prop_get_symbol(sym_get_choice_prop(sym));
for_all_prompts(sym, prop) { for_all_prompts(sym, prop) {
prop->visible.tri = expr_calc_value(prop->visible.expr); prop->visible.tri = expr_calc_value(prop->visible.expr);
/*
* Tristate choice_values with visibility 'mod' are
* not visible if the corresponding choice's value is
* 'yes'.
*/
if (choice_sym && sym->type == S_TRISTATE &&
prop->visible.tri == mod && choice_sym->curr.tri == yes)
prop->visible.tri = no;
tri = EXPR_OR(tri, prop->visible.tri); tri = EXPR_OR(tri, prop->visible.tri);
} }
if (tri == mod && (sym->type != S_TRISTATE || modules_val == no)) if (tri == mod && (sym->type != S_TRISTATE || modules_val == no))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment