Commit a4cff327 authored by Masahiro Yamada's avatar Masahiro Yamada

kconfig: clean up nested if-conditionals in check_conf()

Unify the outer two if-conditionals into one. This decreases the
indent level by one.

Also, change the if-else blocks:

    if (input_mode == listnewconfig) {
            ...
    } else if (input_mode == helpnewconfig) {
            ...
    } else {
            ...
    }

into the switch statement.
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent f82bd80d
......@@ -419,10 +419,12 @@ static void check_conf(struct menu *menu)
return;
sym = menu->sym;
if (sym && !sym_has_value(sym)) {
if (sym_is_changeable(sym) ||
(sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {
if (input_mode == listnewconfig) {
if (sym && !sym_has_value(sym) &&
(sym_is_changeable(sym) ||
(sym_is_choice(sym) && sym_get_tristate_value(sym) == yes))) {
switch (input_mode) {
case listnewconfig:
if (sym->name) {
const char *str;
......@@ -436,17 +438,18 @@ static void check_conf(struct menu *menu)
printf("%s%s=%s\n", CONFIG_, sym->name, str);
}
}
} else if (input_mode == helpnewconfig) {
break;
case helpnewconfig:
printf("-----\n");
print_help(menu);
printf("-----\n");
} else {
break;
default:
if (!conf_cnt++)
printf("*\n* Restart config...\n*\n");
rootEntry = menu_get_parent_menu(menu);
conf(rootEntry);
}
break;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment