Reason for GPS problems found! / more patches

NeilBrown neilb at suse.de
Tue Jul 22 23:21:56 CEST 2008


On Wed, July 23, 2008 1:42 am, Alexey Feldgendler wrote:
> On Tue, 22 Jul 2008 17:34:58 +0200, Andy Green <andy at openmoko.com> wrote:
>
>> I guess you're not a kernel coder... not only is the segment for these
>> definitively zero at start of kernel, but it is an offence against
>> ./scripts/checkpatch.pl to explicitly zero these things.
>
> It's strange to have a script that enforces a worse practice, even when
> you really can assume that the segment is zeroed.
>
"worse" is subjective.

int foo = 0;

will put foo in the "initialised data" section with a value of 0.

int foo;

will put foo in the "uninitialised data" section which is guaranteed
to be initialised to zero when the kernel is loaded.

The former adds 4 bytes to the size of vmlinux.

4 bytes isn't much, but if there are hundreds of these, it is just a
waste of space.

If it really offends you, use

  int foo /* = 0 */;

but that isn't really necessary.  It wont take long before you start
reading
   int foo;
in global context as "foo is initialised to 0".

NeilBrown





More information about the community mailing list