diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2007-08-29 23:06:17 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2007-09-01 02:24:09 -0400 |
commit | f82f3f9422d4da1eeec6f6cf3e64c6c34c4fe19b (patch) | |
tree | 86031882adb1561400beea484711e5952142d484 | |
parent | 2f81eccbd7a5440b43ff874c8f02d6143f41ba4f (diff) |
kconfig: oldconfig shall not set symbols if it does not need to
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>
-rw-r--r-- | scripts/kconfig/conf.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 8be6a4269e63..a38787a881ea 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c | |||
@@ -72,7 +72,7 @@ static void check_stdin(void) | |||
72 | } | 72 | } |
73 | } | 73 | } |
74 | 74 | ||
75 | static void conf_askvalue(struct symbol *sym, const char *def) | 75 | static int conf_askvalue(struct symbol *sym, const char *def) |
76 | { | 76 | { |
77 | enum symbol_type type = sym_get_type(sym); | 77 | enum symbol_type type = sym_get_type(sym); |
78 | tristate val; | 78 | tristate val; |
@@ -87,7 +87,7 @@ static void conf_askvalue(struct symbol *sym, const char *def) | |||
87 | printf("%s\n", def); | 87 | printf("%s\n", def); |
88 | line[0] = '\n'; | 88 | line[0] = '\n'; |
89 | line[1] = 0; | 89 | line[1] = 0; |
90 | return; | 90 | return 0; |
91 | } | 91 | } |
92 | 92 | ||
93 | switch (input_mode) { | 93 | switch (input_mode) { |
@@ -97,23 +97,23 @@ static void conf_askvalue(struct symbol *sym, const char *def) | |||
97 | case set_random: | 97 | case set_random: |
98 | if (sym_has_value(sym)) { | 98 | if (sym_has_value(sym)) { |
99 | printf("%s\n", def); | 99 | printf("%s\n", def); |
100 | return; | 100 | return 0; |
101 | } | 101 | } |
102 | break; | 102 | break; |
103 | case ask_new: | 103 | case ask_new: |
104 | case ask_silent: | 104 | case ask_silent: |
105 | if (sym_has_value(sym)) { | 105 | if (sym_has_value(sym)) { |
106 | printf("%s\n", def); | 106 | printf("%s\n", def); |
107 | return; | 107 | return 0; |
108 | } | 108 | } |
109 | check_stdin(); | 109 | check_stdin(); |
110 | case ask_all: | 110 | case ask_all: |
111 | fflush(stdout); | 111 | fflush(stdout); |
112 | fgets(line, 128, stdin); | 112 | fgets(line, 128, stdin); |
113 | return; | 113 | return 1; |
114 | case set_default: | 114 | case set_default: |
115 | printf("%s\n", def); | 115 | printf("%s\n", def); |
116 | return; | 116 | return 1; |
117 | default: | 117 | default: |
118 | break; | 118 | break; |
119 | } | 119 | } |
@@ -123,7 +123,7 @@ static void conf_askvalue(struct symbol *sym, const char *def) | |||
123 | case S_HEX: | 123 | case S_HEX: |
124 | case S_STRING: | 124 | case S_STRING: |
125 | printf("%s\n", def); | 125 | printf("%s\n", def); |
126 | return; | 126 | return 1; |
127 | default: | 127 | default: |
128 | ; | 128 | ; |
129 | } | 129 | } |
@@ -174,6 +174,7 @@ static void conf_askvalue(struct symbol *sym, const char *def) | |||
174 | break; | 174 | break; |
175 | } | 175 | } |
176 | printf("%s", line); | 176 | printf("%s", line); |
177 | return 1; | ||
177 | } | 178 | } |
178 | 179 | ||
179 | int conf_string(struct menu *menu) | 180 | int conf_string(struct menu *menu) |
@@ -187,7 +188,8 @@ int conf_string(struct menu *menu) | |||
187 | def = sym_get_string_value(sym); | 188 | def = sym_get_string_value(sym); |
188 | if (sym_get_string_value(sym)) | 189 | if (sym_get_string_value(sym)) |
189 | printf("[%s] ", def); | 190 | printf("[%s] ", def); |
190 | conf_askvalue(sym, def); | 191 | if (!conf_askvalue(sym, def)) |
192 | return 0; | ||
191 | switch (line[0]) { | 193 | switch (line[0]) { |
192 | case '\n': | 194 | case '\n': |
193 | break; | 195 | break; |
@@ -240,7 +242,8 @@ static int conf_sym(struct menu *menu) | |||
240 | if (menu_has_help(menu)) | 242 | if (menu_has_help(menu)) |
241 | printf("/?"); | 243 | printf("/?"); |
242 | printf("] "); | 244 | printf("] "); |
243 | conf_askvalue(sym, sym_get_string_value(sym)); | 245 | if (!conf_askvalue(sym, sym_get_string_value(sym))) |
246 | return 0; | ||
244 | strip(line); | 247 | strip(line); |
245 | 248 | ||
246 | switch (line[0]) { | 249 | switch (line[0]) { |