kconfig: Remove duplicate call to sym_get_string_value()
authorMickaël Salaün <mic@linux.microsoft.com>
Mon, 15 Feb 2021 18:15:09 +0000 (19:15 +0100)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 24 Feb 2021 06:12:06 +0000 (15:12 +0900)
Use the saved returned value of sym_get_string_value() instead of
calling it twice.

Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com>
Link: https://lore.kernel.org/r/20210215181511.2840674-2-mic@digikod.net
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kconfig/conf.c

index db03e2f..18a233d 100644 (file)
@@ -137,7 +137,7 @@ static int conf_string(struct menu *menu)
                printf("%*s%s ", indent - 1, "", menu->prompt->text);
                printf("(%s) ", sym->name);
                def = sym_get_string_value(sym);
-               if (sym_get_string_value(sym))
+               if (def)
                        printf("[%s] ", def);
                if (!conf_askvalue(sym, def))
                        return 0;