[uml-user] Connecting eth interfaces together

2009-11-08 Thread lanas
Hello all, Is it possible to connect two eth interfaces from different umls together w/o using a switch ? I've tried by having them two go through different host tap devices, as in: tunctl -u user -t tap0 ip a a 192.168.2.100/24 dev tap0 ip l s dev tap0 up tunctl -u user -t tap1 ip a a 192.16

Re: [uml-user] Connecting eth interfaces together

2009-11-08 Thread /dev/rob0
On Sun, Nov 08, 2009 at 09:42:00AM -0500, lanas wrote: > Is it possible to connect two eth interfaces from different umls > together w/o using a switch ? I've tried by having them two go > through different host tap devices, as in: > > tunctl -u user -t tap0 > ip a a 192.168.2.100/24 dev tap0 >

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

2009-11-08 Thread André Goddard Rosa
Change "" to "(null)" and make it a static const char[] hoping that the compiler will make null_str a label to a read-only area containing it. See: http://people.redhat.com/drepper/dsohowto.pdf part 2.4.2 http://udrepper.livejournal.com/13851.html http://udrepper.livejournal.com/15119.html Signed

[uml-user] [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

[uml-user] [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 | 15

[uml-user] [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-user] [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/stri

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

2009-11-08 Thread André Goddard Rosa
No functional change, just refactor the code so that it avoid checking "if (hi)" two times in a sequence, taking advantage of previous check made. It also reduces code size: textdata bss dec hex filename 15735 0 8 157433d7f lib/vsprintf.o-before 15719

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

2009-11-08 Thread André Goddard Rosa
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() to drivers: textdata bss dec hex filename 64867 840 592 66299 102fb (TOTALS-lib.a-before)

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

2009-11-08 Thread André Goddard Rosa
On the following sentence: while (*s && isspace(*s)) s++; If *s == 0, isspace() evaluates to ((_ctype[*s] & 0x20) != 0), which evaluates to ((0x08 & 0x20) != 0) which equals to 0 as well. If *s == 1, we depend on isspace() result anyway. In other words, "a char equals zero is never a

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

2009-11-08 Thread André Goddard Rosa
The difference between simple_strtoul() and simple_strtoull() is just the size of the variable used to keep track of the sum of characters converted to numbers: unsigned long simple_strtoul() {...} unsigned long long simple_strtoull(){...} Both are same size (8 bytes) on my Core 2/gcc 4.4.1. Over

[uml-user] [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 403

[uml-user] [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(+), 36 deleti

[uml-user] [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/lin

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

2009-11-08 Thread André Goddard Rosa
Makes use of skip_spaces() defined in lib/string.c for removing leading spaces from strings all over the tree. Also, while at it, if we see (*str && isspace(*str)), we can be sure to remove the first condition (*str) as the second one (isspace(*str)) also evaluates to 0 whenever *str == 0, making

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

2009-11-08 Thread Alan Cox
On Sat, 7 Nov 2009 13:16:18 -0200 André Goddard Rosa wrote: > On the following sentence: > while (*s && isspace(*s)) > s++; Looks fine but for one thing: it's actually shorter inline than moved into /lib so at the very least it should be a header inline not a function call. Second

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

2009-11-08 Thread Julia Lawall
> > Also, while at it, if we see (*str && isspace(*str)), we can be sure to > > remove the first condition (*str) as the second one (isspace(*str)) also > > evaluates to 0 whenever *str == 0, making it redundant. In other words, > > "a char equals zero is never a space". I tried the following sema

Re: [uml-user] [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() >> to drivers:

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

2009-11-08 Thread James Bottomley
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() > to drivers: >textdata bss dec hex filename

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

2009-11-08 Thread Theodore Tso
On Sat, Nov 07, 2009 at 01:16:20PM -0200, André Goddard Rosa wrote: > Makes use of skip_spaces() defined in lib/string.c for removing leading > spaces from strings all over the tree. > > Also, while at it, if we see (*str && isspace(*str)), we can be sure to > remove the first condition (*str) as