summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2024-03-10 23:16:17 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2024-03-19 02:30:51 +0900
commitb27a91383abc4acca39f4402cdcc74ce4a476d8e (patch)
treef7e6fa5dc23b19cbe832cc39b4c953b2210e45c0 /scripts
parent4957515b9c3aa3d32a1ee44ab77f0a44f29263dc (diff)
downloadlinux-stable-b27a91383abc4acca39f4402cdcc74ce4a476d8e.tar.gz
linux-stable-b27a91383abc4acca39f4402cdcc74ce4a476d8e.tar.bz2
linux-stable-b27a91383abc4acca39f4402cdcc74ce4a476d8e.zip
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>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/confdata.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index c5b6487d68ac..0e35c4819cf1 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -799,10 +799,7 @@ int conf_write_defconfig(const char *filename)
while (menu != NULL)
{
sym = menu->sym;
- if (sym == NULL) {
- if (!menu_is_visible(menu))
- goto next_menu;
- } else if (!sym_is_choice(sym)) {
+ if (sym && !sym_is_choice(sym)) {
sym_calc_value(sym);
if (!(sym->flags & SYMBOL_WRITE))
goto next_menu;