lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220723192211.GP25951@gate.crashing.org>
Date:   Sat, 23 Jul 2022 14:22:11 -0500
From:   Segher Boessenkool <segher@...nel.crashing.org>
To:     Michal Suchánek <msuchanek@...e.de>
Cc:     Jason Wang <wangborong@...rlc.com>, lkp@...el.com,
        linux-kernel@...r.kernel.org, npiggin@...il.com,
        Julia.Lawall@...ia.fr, paulus@...ba.org, joel@....id.au,
        linuxppc-dev@...ts.ozlabs.org, hbathini@...ux.ibm.com
Subject: Re: [PATCH] powerpc: Remove the static variable initialisations to 0

On Sat, Jul 23, 2022 at 03:34:05PM +0200, Michal Suchánek wrote:
> 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.

It did make a difference when the kernel was still compiled with
-fcommon (which used to be the GCC default on most configurations, it is
traditional on Unix).  No explicit initialiser puts an object in .bss if
you use -fcommon.  This matters a bit for data layout.

> The current code is slightly easier to understand.
> 
> And changing the code introduces history noise for na gain.

Yup.

This does give you some code golf points of course ;-)


Segher

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ