Commit 995150e4 authored by Masahiro Yamada's avatar Masahiro Yamada

kconfig: refactor conf_write_defconfig() to reduce indentation level

Reduce the indentation level by continue'ing the loop earlier
if (!sym || sym_is_choice(sym)).

No functional change intended.
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
Reviewed-by: default avatarNicolas Schier <nicolas@fjasle.eu>
parent 826ee96d
...@@ -774,35 +774,32 @@ int conf_write_defconfig(const char *filename) ...@@ -774,35 +774,32 @@ int conf_write_defconfig(const char *filename)
struct menu *choice; struct menu *choice;
sym = menu->sym; sym = menu->sym;
if (sym && !sym_is_choice(sym)) {
if (!sym || sym_is_choice(sym))
continue;
sym_calc_value(sym); sym_calc_value(sym);
if (!(sym->flags & SYMBOL_WRITE)) if (!(sym->flags & SYMBOL_WRITE))
continue; continue;
sym->flags &= ~SYMBOL_WRITE; sym->flags &= ~SYMBOL_WRITE;
/* If we cannot change the symbol - skip */ /* Skip unchangeable symbols */
if (!sym_is_changeable(sym)) if (!sym_is_changeable(sym))
continue; continue;
/* If symbol equals to default value - skip */ /* Skip symbols that are equal to the default */
if (strcmp(sym_get_string_value(sym), sym_get_string_default(sym)) == 0) if (!strcmp(sym_get_string_value(sym), sym_get_string_default(sym)))
continue; continue;
/* /* Skip choice values that are equal to the default */
* If symbol is a choice value and equals to the
* default for a choice - skip.
*/
choice = sym_get_choice_menu(sym); choice = sym_get_choice_menu(sym);
if (choice) { if (choice) {
struct symbol *ds; struct symbol *ds;
ds = sym_choice_default(choice->sym); ds = sym_choice_default(choice->sym);
if (sym == ds) { if (sym == ds && sym_get_tristate_value(sym) == yes)
if (sym_get_tristate_value(sym) == yes)
continue; continue;
} }
}
print_symbol_for_dotconfig(out, sym); print_symbol_for_dotconfig(out, sym);
} }
}
fclose(out); fclose(out);
return 0; return 0;
} }
......
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