2021-02-15 18:16:28

by Mickaël Salaün

[permalink] [raw]
Subject: [PATCH v2 1/3] kconfig: Remove duplicate call to sym_get_string_value()

From: Mickaël Salaün <[email protected]>

Use the saved returned value of sym_get_string_value() instead of
calling it twice.

Cc: Masahiro Yamada <[email protected]>
Signed-off-by: Mickaël Salaün <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
scripts/kconfig/conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index db03e2f45de4..18a233d27a8d 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -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;
--
2.30.0


2021-02-21 08:57:00

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH v2 1/3] kconfig: Remove duplicate call to sym_get_string_value()

On Tue, Feb 16, 2021 at 3:15 AM Mickaël Salaün <[email protected]> wrote:
>
> From: Mickaël Salaün <[email protected]>
>
> Use the saved returned value of sym_get_string_value() instead of
> calling it twice.
>
> Cc: Masahiro Yamada <[email protected]>
> Signed-off-by: Mickaël Salaün <[email protected]>
> Link: https://lore.kernel.org/r/[email protected]
> ---


Applied to linux-kbuild. Thanks.



> scripts/kconfig/conf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
> index db03e2f45de4..18a233d27a8d 100644
> --- a/scripts/kconfig/conf.c
> +++ b/scripts/kconfig/conf.c
> @@ -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;
> --
> 2.30.0
>


--
Best Regards
Masahiro Yamada