mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kconfig: do not assign a variable in the return statement
@ 2020-04-13 15:35 Masahiro Yamada
  2020-04-25 17:00 ` Masahiro Yamada
  0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2020-04-13 15:35 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

I am not a big fan of doing assignment in a return statement.
Split it into two lines.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/menu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index e436ba44c9c5..a5fbd6ccc006 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -65,7 +65,8 @@ void menu_add_entry(struct symbol *sym)
 struct menu *menu_add_menu(void)
 {
 	last_entry_ptr = &current_entry->list;
-	return current_menu = current_entry;
+	current_menu = current_entry;
+	return current_menu;
 }
 
 void menu_end_menu(void)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] kconfig: do not assign a variable in the return statement
  2020-04-13 15:35 [PATCH] kconfig: do not assign a variable in the return statement Masahiro Yamada
@ 2020-04-25 17:00 ` Masahiro Yamada
  0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2020-04-25 17:00 UTC (permalink / raw)
  To: Linux Kbuild mailing list; +Cc: Linux Kernel Mailing List

On Tue, Apr 14, 2020 at 12:35 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> I am not a big fan of doing assignment in a return statement.
> Split it into two lines.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>



Applied to linux-kbuild.

> ---
>
>  scripts/kconfig/menu.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
> index e436ba44c9c5..a5fbd6ccc006 100644
> --- a/scripts/kconfig/menu.c
> +++ b/scripts/kconfig/menu.c
> @@ -65,7 +65,8 @@ void menu_add_entry(struct symbol *sym)
>  struct menu *menu_add_menu(void)
>  {
>         last_entry_ptr = &current_entry->list;
> -       return current_menu = current_entry;
> +       current_menu = current_entry;
> +       return current_menu;
>  }
>
>  void menu_end_menu(void)
> --
> 2.25.1
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-25 17:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13 15:35 [PATCH] kconfig: do not assign a variable in the return statement Masahiro Yamada
2020-04-25 17:00 ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome