Subject: Re: checkpatch nits ...

From: Sean MacLennan <[email-masked]>
Date: Fri, 22 Aug 2008 20:40:49 -0400

On Fri, 22 Aug 2008 17:21:44 -0700
"Kevin Diggs" <[email-masked]> wrote:

> Hi,
> 
> Can I ignore these checkpatch errors:
> 
> ERROR: do not initialise statics to 0 or NULL
> #829: FILE: powerpc/kernel/cpu/pll_if.c:61:
> +static unsigned int override_bus_clock = 0;
> 
> ERROR: do not initialise externals to 0 or NULL
> #1281: FILE: powerpc/kernel/cpu/pll_if.c:513:
> +int rval = 0;
> 
> Someone (Arnd?) told me this was due to an older compiler putting
> these in a strange section?

Older gcc, and in fact many (most?) compilers, put *all* initialized
variables in a data section rather than the bss. This means they took
up room in the executable. By not explicitly setting them to zero, they
where put in the bss and initialized to zero anyway.

Newer gccs will put them in the bss if they are zero. You could argue
that this is technically wrong.

I tend to remove the 0s or nulls just to cut down on the checkpatch
errors. You need to decide if it is worth it. I wouldn't submit a patch
with *just* these changes.

Cheers,
   Sean