Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>

+22 -25
+22 -25
scripts/kconfig/confdata.c
··· 774 774 struct menu *choice; 775 775 776 776 sym = menu->sym; 777 - if (sym && !sym_is_choice(sym)) { 778 - sym_calc_value(sym); 779 - if (!(sym->flags & SYMBOL_WRITE)) 780 - continue; 781 - sym->flags &= ~SYMBOL_WRITE; 782 - /* If we cannot change the symbol - skip */ 783 - if (!sym_is_changeable(sym)) 784 - continue; 785 - /* If symbol equals to default value - skip */ 786 - if (strcmp(sym_get_string_value(sym), sym_get_string_default(sym)) == 0) 787 - continue; 788 777 789 - /* 790 - * If symbol is a choice value and equals to the 791 - * default for a choice - skip. 792 - */ 793 - choice = sym_get_choice_menu(sym); 794 - if (choice) { 795 - struct symbol *ds; 778 + if (!sym || sym_is_choice(sym)) 779 + continue; 796 780 797 - ds = sym_choice_default(choice->sym); 798 - if (sym == ds) { 799 - if (sym_get_tristate_value(sym) == yes) 800 - continue; 801 - } 802 - } 803 - print_symbol_for_dotconfig(out, sym); 781 + sym_calc_value(sym); 782 + if (!(sym->flags & SYMBOL_WRITE)) 783 + continue; 784 + sym->flags &= ~SYMBOL_WRITE; 785 + /* Skip unchangeable symbols */ 786 + if (!sym_is_changeable(sym)) 787 + continue; 788 + /* Skip symbols that are equal to the default */ 789 + if (!strcmp(sym_get_string_value(sym), sym_get_string_default(sym))) 790 + continue; 791 + 792 + /* Skip choice values that are equal to the default */ 793 + choice = sym_get_choice_menu(sym); 794 + if (choice) { 795 + struct symbol *ds; 796 + 797 + ds = sym_choice_default(choice->sym); 798 + if (sym == ds && sym_get_tristate_value(sym) == yes) 799 + continue; 804 800 } 801 + print_symbol_for_dotconfig(out, sym); 805 802 } 806 803 fclose(out); 807 804 return 0;