From a4663911392efdc504ce97b192d46f2677a6fe35 Mon Sep 17 00:00:00 2001 From: Paul Bolle Date: Wed, 16 Mar 2016 21:27:27 +0100 Subject: kconfig: add unexpected data itself to warning If the .config parser runs into unexpected data it emits warnings like: .config:6911:warning: unexpected data Add the unexpected data itself to this warning. That makes it easier to discover what is actually going wrong: .config:6911:warning: unexpected data: CONFOG_CHARGER_TPS65217=m Signed-off-by: Paul Bolle Signed-off-by: Michal Marek --- scripts/kconfig/confdata.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts/kconfig') diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index dd243d2..297b079 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -375,7 +375,9 @@ load: continue; } else { if (line[0] != '\r' && line[0] != '\n') - conf_warning("unexpected data"); + conf_warning("unexpected data: %.*s", + (int)strcspn(line, "\r\n"), line); + continue; } setsym: -- cgit v1.1 From fa64e5f6a35efd5e77d639125d973077ca506074 Mon Sep 17 00:00:00 2001 From: Dirk Gouders Date: Fri, 29 Apr 2016 10:24:52 +0200 Subject: kconfig/symbol.c: handle choice_values that depend on 'm' symbols If choices consist of choice_values of type tristate that depend on symbols set to 'm', those choice_values are not set to 'n' if the choice is changed from 'm' to 'y' (in which case only one active choice_value is allowed). Those values are also written to the config file causing modules to be built when they should not. The following config can be used to reproduce and examine the problem; with the frontend of your choice set "Choice 0" and "Choice 1" to 'm', then set "Tristate Choice" to 'y' and save the configuration: config modules boolean modules default y option modules config dependency tristate "Dependency" default m choice prompt "Tristate Choice" default choice0 config choice0 tristate "Choice 0" config choice1 tristate "Choice 1" depends on dependency endchoice This patch sets tristate choice_values' visibility that depend on symbols set to 'm' to 'n' if the corresponding choice is set to 'y'. This makes them disappear from the choice list and will also cause the choice_values' value set to 'n' in sym_calc_value() and as a result they are written as "not set" to the resulting .config file. Reported-by: Sebastian Andrzej Siewior Signed-off-by: Dirk Gouders Tested-by: Sebastian Andrzej Siewior Tested-by: Roger Quadros Signed-off-by: Michal Marek --- scripts/kconfig/symbol.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'scripts/kconfig') diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 25cf0c2..2432298 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -209,12 +209,26 @@ static void sym_set_all_changed(void) static void sym_calc_visibility(struct symbol *sym) { struct property *prop; + struct symbol *choice_sym = NULL; tristate tri; /* any prompt visible? */ tri = no; + + if (sym_is_choice_value(sym)) + choice_sym = prop_get_symbol(sym_get_choice_prop(sym)); + for_all_prompts(sym, prop) { 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); } if (tri == mod && (sym->type != S_TRISTATE || modules_val == no)) -- cgit v1.1