Randy Dunlap <[email protected]> wrote:
> Bela Lubkin wrote:
> > Andrew Morton wrote:
> >
> >>> Sometime, please go through the IPMI code looking for all these
> >>> statically-allocated things which are initialised to 0 or NULL and remove
> >>> all those intialisations? They're unneeded, they increase the vmlinux
> >>> image size and there are quite a number of them. Thanks.
> > Randy Dunlop replied:
> >
> >> I was just about to send that patch. Here it is,
> >> on top of the series-of-12.
> > ...
> >> -static int bt_debug = BT_DEBUG_OFF;
> >> +static int bt_debug;
> > Is it wise to significantly degrade code readability to work around
> > a minor
> > compiler / linker bug?
>
> Is that the only one that is a problem?
>
> I don't think it's a problem. We *know* that static data areas
> are init to 0. Everything depends on that. If that didn't work
> it would all break.
Right. And we know NULL == 0.
> I could say that it's a nice coincidence that BT_DEBUG_OFF == 0,
> but I think that it's more than coincidence.
I'd have had to look over the code to find out what it was initialized
to. In cases where it is not an explicit 0/NULL, I'd leave it as is. It
could also break if somebody later on changes the value of BT_DEBUG_OFF
(yes, very unlikely, but...).
Bug your friendly GCC guy to loose static initializations to zero
(shouldn't be /that/ hard to do...) instead of obfuscating kernel's code.
--
Dr. Horst H. von Brand User #22616 counter.li.org
Departamento de Informatica Fono: +56 32 2654431
Universidad Tecnica Federico Santa Maria +56 32 2654239
Casilla 110-V, Valparaiso, Chile Fax: +56 32 2797513
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]