[uml-devel] [PATCH v4 04/12] vsprintf: use TOLOWER whenever possible

2009-11-08 Thread André Goddard Rosa
It decreases code size as well: textdata bss dec hex filename 15767 0 8 157753d9f lib/vsprintf.o-before 15735 0 8 157433d7f lib/vsprintf.o-TOLOWER Signed-off-by: André Goddard Rosa Acked-by: Frederic Weisbecker --- lib/vsprintf.c

[uml-devel] [PATCH v4 12/12] tree-wide: convert open calls to remove spaces to skip_spaces() lib function

2009-11-08 Thread André Goddard Rosa
, making it redundant. In other words, "a char equals zero is never a space". Signed-off-by: André Goddard Rosa --- arch/s390/kernel/debug.c |3 +- arch/um/drivers/mconsole_kern.c | 16 ++ arch/x86/kernel/cpu/mtrr/if.c | 11 +++-- dri

[uml-devel] [PATCH v4 03/12] vsprintf: give it some care to please checkpatch.pl

2009-11-08 Thread André Goddard Rosa
Most relevant complaints were addressed. Signed-off-by: André Goddard Rosa Acked-by: Frederic Weisbecker --- lib/vsprintf.c | 186 ++-- 1 files changed, 99 insertions(+), 87 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index

[uml-devel] [PATCH v4 00/12] introduce skip_spaces(), reducing code size plus some clean-ups

2009-11-08 Thread André Goddard Rosa
ction v3: improved comments on patch 5/7 and factorize a switch statement on 6/7 as per suggestions from Ingo and Frederic (thanks!) v2: addressed feedback from Frederic Weisbecker review (thanks!!) and split into separate patches v1: original submission André Goddard Rosa (12): vsp

[uml-devel] [PATCH v4 01/12] vsprintf: factorize "(null)" string

2009-11-08 Thread André Goddard Rosa
urnal.com/15119.html Signed-off-by: André Goddard Rosa Acked-by: Frederic Weisbecker --- lib/vsprintf.c | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 33bed5e..002f462 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -34,6 +34

[uml-devel] [PATCH v4 09/12] ctype: constify read-only _ctype string

2009-11-08 Thread André Goddard Rosa
While at it, use tabs to indent the comments. Signed-off-by: André Goddard Rosa --- include/linux/ctype.h |2 +- lib/ctype.c | 50 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/include/linux/ctype.h b/include

[uml-devel] [PATCH v4 08/12] vsprintf: reuse almost identical simple_strtoulX() functions

2009-11-08 Thread André Goddard Rosa
f lib/vsprintf.o-after Signed-off-by: André Goddard Rosa Acked-by: Ingo Molnar --- lib/vsprintf.c | 48 ++-- 1 files changed, 14 insertions(+), 34 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 566c947..7ec96a3 100644 --- a/lib/vsprintf.c

[uml-devel] [PATCH v4 07/12] vsprintf: factor out skip_space code in a separate function

2009-11-08 Thread André Goddard Rosa
It decreases code size: textdata bss dec hex filename 15719 0 8 157273d6f lib/vsprintf.o-before 15543 0 8 155513cbf lib/vsprintf.o-after Signed-off-by: André Goddard Rosa Acked-by: Frederic Weisbecker --- lib/vsprintf.c | 19

[uml-devel] [PATCH v4 06/12] vsprintf: move local vars to block local vars and remove unneeded ones

2009-11-08 Thread André Goddard Rosa
Cleanup by moving variables closer to the scope where they're used in fact. Also, remove unneeded ones. Signed-off-by: André Goddard Rosa Acked-by: Frederic Weisbecker --- lib/vsprintf.c | 64 --- 1 files changed, 28 insertions(+

[uml-devel] [PATCH v4 02/12] vsprintf: pre-calculate final string length for later use

2009-11-08 Thread André Goddard Rosa
Signed-off-by: André Goddard Rosa Acked-by: Frederic Weisbecker --- lib/vsprintf.c | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 002f462..403e835 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -1445,13 +1445,15 @@ do

Re: [uml-devel] [dm-devel] [PATCH v4 00/12] introduce skip_spaces(), reducing code size plus some clean-ups

2009-11-08 Thread André Goddard Rosa
Hi, James! On Sun, Nov 8, 2009 at 2:05 PM, James Bottomley wrote: > On Sat, 2009-11-07 at 13:16 -0200, André Goddard Rosa wrote: >> This patch reduces lib.a code size by 173 bytes on my Core 2 with gcc 4.4.1 >> even considering that it exports a newly defined function skip_spaces(

[uml-devel] [PATCH v4 10/12] string: factorize skip_spaces and export it to be generally available

2009-11-08 Thread André Goddard Rosa
quals zero is never a space". So remove this check. Also, *s != 0 is by far the most common case (non-empty string). Signed-off-by: André Goddard Rosa --- include/linux/string.h |1 + lib/string.c | 19 +++ 2 files changed, 16 insertions(+), 4 deletions(-)

[uml-devel] [PATCH v4 05/12] vsprintf: reduce code size by avoiding extra check

2009-11-08 Thread André Goddard Rosa
re 15719 0 8 157273d6f lib/vsprintf.o-minus-double-check Signed-off-by: André Goddard Rosa Acked-by: Frederic Weisbecker --- lib/vsprintf.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 14e4197..af79152 100644

[uml-devel] [PATCH v4 11/12] string: on strstrip(), first remove leading spaces before running over str

2009-11-08 Thread André Goddard Rosa
... so that strlen() iterates over a smaller string comprising of the remaining characters only. Signed-off-by: André Goddard Rosa --- lib/string.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/string.c b/lib/string.c index d9a51d5..cf86eab 100644 --- a/lib