aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
authorArnaud Lacombe <lacombar@gmail.com>2010-08-24 00:14:47 -0400
committerArnaud Lacombe <lacombar@gmail.com>2010-09-19 18:19:16 -0400
commit8baefd30b5b0101aa07aa75da44a9eee881eed28 (patch)
tree02c72db82a9f9f9aade25a11bf9e6b884806cdec /scripts/kconfig
parent71d8066265896a6498a4de1bed80dea8dc5daead (diff)
kconfig: replace a `switch()' statement by a more flexible `if()' statement
With the upcoming dynamical configuration prefix, we can no longer assume that the prefix will start by a 'C'. As such, we can no longer hardcode this value in the `case ...:', so replace the `switch() { ... }' statement by a more flexible 'if () { ... }' statement. Signed-off-by: Arnaud Lacombe <lacombar@gmail.com> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/confdata.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index dc11d51bd8b3..d9181de78927 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -221,8 +221,7 @@ load:
221 while (fgets(line, sizeof(line), in)) { 221 while (fgets(line, sizeof(line), in)) {
222 conf_lineno++; 222 conf_lineno++;
223 sym = NULL; 223 sym = NULL;
224 switch (line[0]) { 224 if (line[0] == '#') {
225 case '#':
226 if (memcmp(line + 2, "CONFIG_", 7)) 225 if (memcmp(line + 2, "CONFIG_", 7))
227 continue; 226 continue;
228 p = strchr(line + 9, ' '); 227 p = strchr(line + 9, ' ');
@@ -254,12 +253,7 @@ load:
254 default: 253 default:
255 ; 254 ;
256 } 255 }
257 break; 256 } else if (memcmp(line, "CONFIG_", 7) == 0) {
258 case 'C':
259 if (memcmp(line, "CONFIG_", 7)) {
260 conf_warning("unexpected data");
261 continue;
262 }
263 p = strchr(line + 7, '='); 257 p = strchr(line + 7, '=');
264 if (!p) 258 if (!p)
265 continue; 259 continue;
@@ -286,12 +280,9 @@ load:
286 } 280 }
287 if (conf_set_sym_val(sym, def, def_flags, p)) 281 if (conf_set_sym_val(sym, def, def_flags, p))
288 continue; 282 continue;
289 break; 283 } else {
290 case '\r': 284 if (line[0] != '\r' && line[0] != '\n')
291 case '\n': 285 conf_warning("unexpected data");
292 break;
293 default:
294 conf_warning("unexpected data");
295 continue; 286 continue;
296 } 287 }
297 if (sym && sym_is_choice_value(sym)) { 288 if (sym && sym_is_choice_value(sym)) {