Re: [patch 2/2] kernel/power/disk.c string fix and if-less iterator

From: Domen Puncer
Date: Tue Jun 21 2005 - 04:15:57 EST


On 21/06/05 00:10 +0200, Pavel Machek wrote:
> Hi!
>
> > The attached patch:
> >
> > o Fixes kernel/power/disk.c string declared as 'char *p = "...";' to be
> > declared as 'char p[] = "...";', as pointed by Jeff Garzik.
>
> ? Why was char *p ... wrong? Because you could not do sizeof() later?

It usualy generates shorter binary, because there's no pointer variable.
Doesn't seem so in this case:
text data bss dec hex filename
before: 2333 389 8 2730 aaa kernel/power/disk.o
after: 2349 389 8 2746 aba kernel/power/disk.o

static const char[] makes it same, so no real gain there either :-(

Sorry for the noise.


Domen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/