Skip to content

Commit

Permalink
kconfig: remove unused code for S_DEF_AUTO in conf_read_simple()
Browse files Browse the repository at this point in the history
The 'else' arm here is unreachable in practical use cases.

include/config/auto.conf does not include "# CONFIG_... is not set"
line unless it is manually hacked.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
  • Loading branch information
Masahiro Yamada committed Nov 28, 2023
1 parent 4d137ab commit 92d4fe0
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions scripts/kconfig/confdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,20 +436,15 @@ int conf_read_simple(const char *name, int def)
*p++ = 0;
if (strncmp(p, "is not set", 10))
continue;
if (def == S_DEF_USER) {
sym = sym_find(line + 2 + strlen(CONFIG_));
if (!sym) {
if (warn_unknown)
conf_warning("unknown symbol: %s",
line + 2 + strlen(CONFIG_));

conf_set_changed(true);
continue;
}
} else {
sym = sym_lookup(line + 2 + strlen(CONFIG_), 0);
if (sym->type == S_UNKNOWN)
sym->type = S_BOOLEAN;
sym = sym_find(line + 2 + strlen(CONFIG_));
if (!sym) {
if (warn_unknown)
conf_warning("unknown symbol: %s",
line + 2 + strlen(CONFIG_));

conf_set_changed(true);
continue;
}
if (sym->flags & def_flags) {
conf_warning("override: reassigning to symbol %s", sym->name);
Expand Down

0 comments on commit 92d4fe0

Please sign in to comment.