Skip to content

Commit b27a913

Browse files
committed
kconfig: remove unneeded menu_is_visible() call in conf_write_defconfig()
When the condition 'sym == NULL' is met, the code will reach the 'next_menu' label regardless of the return value from menu_is_visible(). menu_is_visible() calculates some symbol values as a side-effect, for instance by calling expr_calc_value(menu->visibility), but all the symbol values will be calculated eventually. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent 4957515 commit b27a913

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

scripts/kconfig/confdata.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -799,10 +799,7 @@ int conf_write_defconfig(const char *filename)
799799
while (menu != NULL)
800800
{
801801
sym = menu->sym;
802-
if (sym == NULL) {
803-
if (!menu_is_visible(menu))
804-
goto next_menu;
805-
} else if (!sym_is_choice(sym)) {
802+
if (sym && !sym_is_choice(sym)) {
806803
sym_calc_value(sym);
807804
if (!(sym->flags & SYMBOL_WRITE))
808805
goto next_menu;

0 commit comments

Comments
 (0)