From: Sean MacLennan <smaclennan@pikatech.com>
To: "Kevin Diggs" <kevdig@hypersurf.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: checkpatch nits ...
Date: Fri, 22 Aug 2008 20:40:49 -0400 [thread overview]
Message-ID: <20080822204049.49fcd22d@lappy.seanm.ca> (raw)
In-Reply-To: <48AF5818.7010802@hypersurf.com>
On Fri, 22 Aug 2008 17:21:44 -0700
"Kevin Diggs" <kevdig@hypersurf.com> 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
next prev parent reply other threads:[~2008-08-23 0:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-23 0:21 checkpatch nits Kevin Diggs
2008-08-23 0:40 ` Sean MacLennan [this message]
2008-08-23 8:57 ` Arnd Bergmann
2008-08-27 7:49 ` Wolfram Sang
2008-08-28 7:51 ` Andy Whitcroft
2008-08-24 12:23 ` David Howells
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=20080822204049.49fcd22d@lappy.seanm.ca \
--to=smaclennan@pikatech.com \
--cc=kevdig@hypersurf.com \
--cc=linuxppc-dev@ozlabs.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).