All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michal Suchánek" <msuchanek@suse.de>
To: Jason Wang <wangborong@cdjrlc.com>
Cc: lkp@intel.com, linux-kernel@vger.kernel.org, npiggin@gmail.com,
	Julia.Lawall@inria.fr, paulus@samba.org, joel@jms.id.au,
	linuxppc-dev@lists.ozlabs.org, hbathini@linux.ibm.com
Subject: Re: [PATCH] powerpc: Remove the static variable initialisations to 0
Date: Sat, 23 Jul 2022 15:34:05 +0200	[thread overview]
Message-ID: <20220723133405.GF17705@kitsune.suse.cz> (raw)
In-Reply-To: <20220723092436.7149-1-wangborong@cdjrlc.com>

Hello,

On Sat, Jul 23, 2022 at 05:24:36PM +0800, Jason Wang wrote:
> Initialise global and static variable to 0 is always unnecessary.
> Remove the unnecessary initialisations.

Isn't this change also unnecessary?

Initializing to 0 does not affect correctness, or even any kind of
semantics in any way.

The current code is slightly easier to understand.

And changing the code introduces history noise for na gain.

Thanks

Michal

> 
> Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
> ---
>  arch/powerpc/kexec/core_64.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kexec/core_64.c b/arch/powerpc/kexec/core_64.c
> index c2bea9db1c1e..2407214e3f41 100644
> --- a/arch/powerpc/kexec/core_64.c
> +++ b/arch/powerpc/kexec/core_64.c
> @@ -135,7 +135,7 @@ notrace void kexec_copy_flush(struct kimage *image)
>  
>  #ifdef CONFIG_SMP
>  
> -static int kexec_all_irq_disabled = 0;
> +static int kexec_all_irq_disabled;
>  
>  static void kexec_smp_down(void *arg)
>  {
> -- 
> 2.35.1
> 

WARNING: multiple messages have this Message-ID (diff)
From: "Michal Suchánek" <msuchanek@suse.de>
To: Jason Wang <wangborong@cdjrlc.com>
Cc: paulus@samba.org, lkp@intel.com, linux-kernel@vger.kernel.org,
	npiggin@gmail.com, Julia.Lawall@inria.fr, joel@jms.id.au,
	linuxppc-dev@lists.ozlabs.org, hbathini@linux.ibm.com
Subject: Re: [PATCH] powerpc: Remove the static variable initialisations to 0
Date: Sat, 23 Jul 2022 15:34:05 +0200	[thread overview]
Message-ID: <20220723133405.GF17705@kitsune.suse.cz> (raw)
In-Reply-To: <20220723092436.7149-1-wangborong@cdjrlc.com>

Hello,

On Sat, Jul 23, 2022 at 05:24:36PM +0800, Jason Wang wrote:
> Initialise global and static variable to 0 is always unnecessary.
> Remove the unnecessary initialisations.

Isn't this change also unnecessary?

Initializing to 0 does not affect correctness, or even any kind of
semantics in any way.

The current code is slightly easier to understand.

And changing the code introduces history noise for na gain.

Thanks

Michal

> 
> Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
> ---
>  arch/powerpc/kexec/core_64.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kexec/core_64.c b/arch/powerpc/kexec/core_64.c
> index c2bea9db1c1e..2407214e3f41 100644
> --- a/arch/powerpc/kexec/core_64.c
> +++ b/arch/powerpc/kexec/core_64.c
> @@ -135,7 +135,7 @@ notrace void kexec_copy_flush(struct kimage *image)
>  
>  #ifdef CONFIG_SMP
>  
> -static int kexec_all_irq_disabled = 0;
> +static int kexec_all_irq_disabled;
>  
>  static void kexec_smp_down(void *arg)
>  {
> -- 
> 2.35.1
> 

  reply	other threads:[~2022-07-23 13:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-23  9:24 [PATCH] powerpc: Remove the static variable initialisations to 0 Jason Wang
2022-07-23  9:24 ` Jason Wang
2022-07-23 13:34 ` Michal Suchánek [this message]
2022-07-23 13:34   ` Michal Suchánek
2022-07-23 19:22   ` Segher Boessenkool
2022-07-23 19:22     ` Segher Boessenkool
2022-07-25  3:27     ` Michael Ellerman
2022-07-25  3:27       ` Michael Ellerman
2022-07-25 16:13       ` Segher Boessenkool
2022-07-25 16:13         ` Segher Boessenkool

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220723133405.GF17705@kitsune.suse.cz \
    --to=msuchanek@suse.de \
    --cc=Julia.Lawall@inria.fr \
    --cc=hbathini@linux.ibm.com \
    --cc=joel@jms.id.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lkp@intel.com \
    --cc=npiggin@gmail.com \
    --cc=paulus@samba.org \
    --cc=wangborong@cdjrlc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.