[PATCH] macintosh: no need to initilise statics to 0

Segher Boessenkool segher at kernel.crashing.org
Wed Aug 18 03:44:20 AEST 2021


On Tue, Aug 17, 2021 at 01:59:33PM +0200, Christophe Leroy wrote:
> 
> 
> Le 17/08/2021 à 13:51, Jason Wang a écrit :
> >Global static variables dont need to be initialised to 0. Because
> >the compiler will initilise them.
> 
> It is not the compiler, it is the Kernel. It is done here:
> 
> https://elixir.bootlin.com/linux/v5.14-rc6/source/arch/powerpc/kernel/early_32.c

This implements part of the C language: everything with static storage
duration (which includes all global objects, not just those marked
"static") is initialized.

> Among those 44 changes, only 2 are related to the commit's description.

Yeah.  Don't do that please :-/


Segher


More information about the Linuxppc-dev mailing list