2005-02-01 03:32:27

by Paulo Marques

[permalink] [raw]
Subject: [PATCH 2.6] 4/7 replace uml_strdup by kstrdup


This patch removes the strdup implementation in the UML architecture
(uml_strdup), and updates it to use the kstrdup library function.

Signed-off-by: Paulo Marques <[email protected]>

--
Paulo Marques - http://www.grupopie.com

All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke (1729 - 1797)


Attachments:
patch4 (8.49 kB)

2005-02-02 07:52:31

by Pekka Enberg

[permalink] [raw]
Subject: Re: [PATCH 2.6] 4/7 replace uml_strdup by kstrdup

On Tue, 1 Feb 2005 03:28:31 +0000, [email protected]
<[email protected]> wrote:
> diff -buprN -X dontdiff vanilla-2.6.11-rc2-bk9/arch/um/os-Linux/drivers/tuntap_user.c linux-2.6.11-rc2-bk9/arch/um/os-Linux/drivers/tuntap_user.c
> --- vanilla-2.6.11-rc2-bk9/arch/um/os-Linux/drivers/tuntap_user.c 2004-12-24 21:35:40.000000000 +0000
> +++ linux-2.6.11-rc2-bk9/arch/um/os-Linux/drivers/tuntap_user.c 2005-01-31 20:39:08.591154025 +0000

[snip]

> - pri->dev_name = uml_strdup(buffer);
> + pri->dev_name = kstrdup(buffer);

Please compile-test before submitting.

Pekka

2005-02-02 11:55:36

by Paulo Marques

[permalink] [raw]
Subject: Re: [PATCH 2.6] 4/7 replace uml_strdup by kstrdup

Pekka Enberg wrote:
> On Tue, 1 Feb 2005 03:28:31 +0000, [email protected]
> <[email protected]> wrote:
>
>>diff -buprN -X dontdiff vanilla-2.6.11-rc2-bk9/arch/um/os-Linux/drivers/tuntap_user.c linux-2.6.11-rc2-bk9/arch/um/os-Linux/drivers/tuntap_user.c
>>--- vanilla-2.6.11-rc2-bk9/arch/um/os-Linux/drivers/tuntap_user.c 2004-12-24 21:35:40.000000000 +0000
>>+++ linux-2.6.11-rc2-bk9/arch/um/os-Linux/drivers/tuntap_user.c 2005-01-31 20:39:08.591154025 +0000
>
>
> [snip]
>
>
>>- pri->dev_name = uml_strdup(buffer);
>>+ pri->dev_name = kstrdup(buffer);
>
>
> Please compile-test before submitting.

I'm really sorry about this...

I've compiled with an allyesconfig to validate the changes, but that
doesn't build the UML parts :(

Anyway, thanks for pointing this out. I still haven't got feedback
regarding the acceptance of these patches. If there is a chance they're
accepted, maybe the best thing to do is to post the series again with
this correction and the sound patch corrections.

--
Paulo Marques - http://www.grupopie.com

All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke (1729 - 1797)

2005-02-03 20:04:35

by Blaisorblade

[permalink] [raw]
Subject: Re: [uml-devel] Re: [PATCH 2.6] 4/7 replace uml_strdup by kstrdup

On Wednesday 02 February 2005 12:55, you wrote:
> Pekka Enberg wrote:
> > On Tue, 1 Feb 2005 03:28:31 +0000, [email protected]
> >
> > <[email protected]> wrote:
> >>diff -buprN -X dontdiff
> >> vanilla-2.6.11-rc2-bk9/arch/um/os-Linux/drivers/tuntap_user.c
> >> linux-2.6.11-rc2-bk9/arch/um/os-Linux/drivers/tuntap_user.c ---
> >> vanilla-2.6.11-rc2-bk9/arch/um/os-Linux/drivers/tuntap_user.c
> >> 2004-12-24 21:35:40.000000000 +0000 +++
> >> linux-2.6.11-rc2-bk9/arch/um/os-Linux/drivers/tuntap_user.c 2005-01-31
> >> 20:39:08.591154025 +0000
> >
> > [snip]
> >
> >>- pri->dev_name = uml_strdup(buffer);
> >>+ pri->dev_name = kstrdup(buffer);
> >
> > Please compile-test before submitting.
>
> I'm really sorry about this...
>
> I've compiled with an allyesconfig to validate the changes, but that
> doesn't build the UML parts :(

Well, the answer is to do add a "ARCH=um" to the build commands... you could
maybe use a "make defconfig ARCH=um" however because UML itself, sometimes,
does not build with allyesconfig /allmodconfig...

However, that said, there are bigger problems for UML.

Since of its particular nature, it contains some code which is compiled
against userspace headers. For instance cow_user.c (the list includes
*_user.c and everything that is explicitly listed in USER_OBJS inside the
Makefiles)

So, for cow_user.c, when you add <linux/string.h> to cow_user.c, you are
actually making it include /usr/include/linux/string.h...

For UML, you should probably add the prototype to a good header inside
arch/um/include (those headers are in the searchpath for every file under
arch/um) - probably the one which declared uml_strdup. Yes, we have had to
duplicate prototypes for many functions... for inlines, we've had to provide
in many case a non-inline version.

> Anyway, thanks for pointing this out. I still haven't got feedback
> regarding the acceptance of these patches. If there is a chance they're
> accepted, maybe the best thing to do is to post the series again with
> this correction and the sound patch corrections.

--
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade

2005-02-04 12:49:31

by Paulo Marques

[permalink] [raw]
Subject: Re: [uml-devel] Re: [PATCH 2.6] 4/7 replace uml_strdup by kstrdup

Blaisorblade wrote:
>[...]
> For UML, you should probably add the prototype to a good header inside
> arch/um/include (those headers are in the searchpath for every file under
> arch/um) - probably the one which declared uml_strdup. Yes, we have had to
> duplicate prototypes for many functions... for inlines, we've had to provide
> in many case a non-inline version.

Thanks for the tip. I'll have to read the code more carefully to
understand better where the userspace ends and the kernel begins, so
that I don't do similar mistakes in the future.

I'll redo the patch and post it for review, probably during next week. I
don't think there is much hurry, because, even if this gets accepted, it
should go in only in 2.6.12-rc1-mm1 or something like that, so there is
still time to review this more carefully.

Thanks for reviewing the patch,

--
Paulo Marques - http://www.grupopie.com

All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke (1729 - 1797)