lkml.org 
[lkml]   [2000]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] removal of "static foo = 0" from drivers/ide (test11)
Date
Rusty Russell writes:
> What irritates about these monkey-see-monkey-do patches is that if I
> initialize a variable to NULL, it's because my code actually relies on
> it; I don't want that information eliminated.

What information is lost? Unless you're working on a really strange
machine which does not zero bss, the following means the same from the
codes point of view:

static int foo = 0;
static int foo;

Both are initialised to zero by the time the code sees them for the
first time. Therefore there is no difference to the code in its reliance
on whether foo is zero. foo will be zero in both cases.

Also, any good programmer worth their skin should know this, and should
realise it. Therefore, there is no information loss about what value
that variable is expected to hold at initialisation time.

The only difference is the size on disk; if we go around setting every
bss variable to zero, the kernel/module data size will unnecessarily
huge.

We already argue about the extra couple of bytes that xx change to the
kernel/a module would cost. With these change, we save kilo-bytes in
disk space (which is important on some systems).
_____
|_____| ------------------------------------------------- ---+---+-
| | Russell King rmk@arm.linux.org.uk --- ---
| | | | http://www.arm.linux.org.uk/personal/aboutme.html / / |
| +-+-+ --- -+-
/ | THE developer of ARM Linux |+| /|\
/ | | | --- |
+-+-+ ------------------------------------------------- /\\\ |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:47    [W:0.062 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site