From: Masahiro Yamada Date: Thu, 11 Jul 2019 07:33:17 +0000 (+0900) Subject: kconfig: remove meaningless if-conditional in conf_read() X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=06b75a1e922ecfa65eae40eb17b63458439c5c11;p=carl9170fw.git kconfig: remove meaningless if-conditional in conf_read() sym_is_choice(sym) has already been checked by previous if-block: if (sym_is_choice(sym) || (sym->flags & SYMBOL_NO_WRITE)) continue; Hence, the following code is redundant, and the comment is misleading: if (!sym_is_choice(sym)) continue; /* fall through */ It always takes 'continue', never falls though. Clean up the dead code. Signed-off-by: Masahiro Yamada Signed-off-by: Christian Lamparter --- diff --git a/config/confdata.c b/config/confdata.c index a38b508..ab42aa6 100644 --- a/config/confdata.c +++ b/config/confdata.c @@ -534,11 +534,9 @@ int conf_read(const char *name) switch (sym->type) { case S_BOOLEAN: case S_TRISTATE: - if (sym->def[S_DEF_USER].tri != sym_get_tristate_value(sym)) - break; - if (!sym_is_choice(sym)) + if (sym->def[S_DEF_USER].tri == sym_get_tristate_value(sym)) continue; - /* fall through */ + break; default: if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val)) continue;