diff options
author | Arnaud Lacombe <lacombar@gmail.com> | 2010-08-24 06:14:47 +0200 |
---|---|---|
committer | Arnaud Lacombe <lacombar@gmail.com> | 2010-09-20 00:19:16 +0200 |
commit | 8baefd30b5b0101aa07aa75da44a9eee881eed28 (patch) | |
tree | 02c72db82a9f9f9aade25a11bf9e6b884806cdec | |
parent | kbuild: fix oldnoconfig to do the right thing (diff) | |
download | linux-8baefd30b5b0101aa07aa75da44a9eee881eed28.tar.xz linux-8baefd30b5b0101aa07aa75da44a9eee881eed28.zip |
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>
-rw-r--r-- | scripts/kconfig/confdata.c | 19 |
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: while (fgets(line, sizeof(line), in)) { conf_lineno++; sym = NULL; - switch (line[0]) { - case '#': + if (line[0] == '#') { if (memcmp(line + 2, "CONFIG_", 7)) continue; p = strchr(line + 9, ' '); @@ -254,12 +253,7 @@ load: default: ; } - break; - case 'C': - if (memcmp(line, "CONFIG_", 7)) { - conf_warning("unexpected data"); - continue; - } + } else if (memcmp(line, "CONFIG_", 7) == 0) { p = strchr(line + 7, '='); if (!p) continue; @@ -286,12 +280,9 @@ load: } if (conf_set_sym_val(sym, def, def_flags, p)) continue; - break; - case '\r': - case '\n': - break; - default: - conf_warning("unexpected data"); + } else { + if (line[0] != '\r' && line[0] != '\n') + conf_warning("unexpected data"); continue; } if (sym && sym_is_choice_value(sym)) { |