summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2007-09-01 08:29:40 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2007-09-26 10:54:37 -0700
commitbf3bc19248f00e6939a37e2d5bddde48505e0dda (patch)
tree404eeda69a839e3470e9bd06dc943bbaacb49fc9
parent05d1e31ad2d5e3b6c20c0d9d63d511f0d89e4b3f (diff)
kconfig: oldconfig shall not set symbols if it does not need to
commit f82f3f9422d4da1eeec6f6cf3e64c6c34c4fe19b in mainline. Avoid setting the value if the symbol doesn't need to be changed or can't be changed. Later choices may change the dependencies and thus the possible input range. make oldconfig from a 2.6.22 .config with CONFIG_HOTPLUG_CPU not set was in some configurations setting CONFIG_HOTPLUG_CPU=y without asking, even when there was no actual requirement for CONFIG_HOTPLUG_CPU. This was triggered by SUSPEND_SMP that does a select HOTPLUG_CPU. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Tested-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--scripts/kconfig/conf.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 1199baf866ca..45550d2b6ef5 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -64,7 +64,7 @@ static void check_stdin(void)
}
}
-static void conf_askvalue(struct symbol *sym, const char *def)
+static int conf_askvalue(struct symbol *sym, const char *def)
{
enum symbol_type type = sym_get_type(sym);
tristate val;
@@ -79,7 +79,7 @@ static void conf_askvalue(struct symbol *sym, const char *def)
printf("%s\n", def);
line[0] = '\n';
line[1] = 0;
- return;
+ return 0;
}
switch (input_mode) {
@@ -89,23 +89,23 @@ static void conf_askvalue(struct symbol *sym, const char *def)
case set_random:
if (sym_has_value(sym)) {
printf("%s\n", def);
- return;
+ return 0;
}
break;
case ask_new:
case ask_silent:
if (sym_has_value(sym)) {
printf("%s\n", def);
- return;
+ return 0;
}
check_stdin();
case ask_all:
fflush(stdout);
fgets(line, 128, stdin);
- return;
+ return 1;
case set_default:
printf("%s\n", def);
- return;
+ return 1;
default:
break;
}
@@ -115,7 +115,7 @@ static void conf_askvalue(struct symbol *sym, const char *def)
case S_HEX:
case S_STRING:
printf("%s\n", def);
- return;
+ return 1;
default:
;
}
@@ -166,6 +166,7 @@ static void conf_askvalue(struct symbol *sym, const char *def)
break;
}
printf("%s", line);
+ return 1;
}
int conf_string(struct menu *menu)
@@ -179,7 +180,8 @@ int conf_string(struct menu *menu)
def = sym_get_string_value(sym);
if (sym_get_string_value(sym))
printf("[%s] ", def);
- conf_askvalue(sym, def);
+ if (!conf_askvalue(sym, def))
+ return 0;
switch (line[0]) {
case '\n':
break;
@@ -236,7 +238,8 @@ static int conf_sym(struct menu *menu)
if (sym->help)
printf("/?");
printf("] ");
- conf_askvalue(sym, sym_get_string_value(sym));
+ if (!conf_askvalue(sym, sym_get_string_value(sym)))
+ return 0;
strip(line);
switch (line[0]) {