lkml.org 
[lkml]   [2022]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2022-07-23 21:30    [W:0.066 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site