History

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.

Masahiro Yamada committed 7 years ago

Commit e3cd5131 parent baa23ec1 file · +2 −4Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/kconfig/confdata.c+2−4
@@ -534,11 +534,9 @@ int conf_read(const char *name) · 533 unmodified lines
534 switch (sym->type) {534 switch (sym->type) {
535 case S_BOOLEAN:535 case S_BOOLEAN:
536 case S_TRISTATE:536 case S_TRISTATE:
537 if (sym->def[S_DEF_USER].tri != sym_get_tristate_value(sym))537 if (sym->def[S_DEF_USER].tri == sym_get_tristate_value(sym))
538 break;
539 if (!sym_is_choice(sym))
540 continue;538 continue;
541 /* fall through */539 break;
542 default:540 default:
543 if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val))541 if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val))
544 continue;542 continue;