Re: [Patch -mm 1/1] driver core: Introduce device_move(): move adevice to a new parent.

From: Cornelia Huck
Date: Mon Nov 20 2006 - 10:39:50 EST


On Mon, 20 Nov 2006 15:15:03 +0100,
Kay Sievers <kay.sievers@xxxxxxxx> wrote:

> > +void kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
> > + int num_envp, char *envp[])
>
> We usually use a NULL terminated array for things like this. Does
> passing the number of entries give us an advantage?

In do_kobject_uevent:

envp = kzalloc((NUM_ENVP + num_envp) * sizeof (char *), GFP_KERNEL);

We would either need to allocate (NUM_ENVP + NUM_EXT_ENVP) or NUM_ENVP
(as before).

> > +{
> > + /* Disallow dumb users. */
> > + if (num_envp > NUM_EXT_ENVP)
> > + return;
>
> Why do we need such a limit? There are still thousand other ways to
> screw things up. :)

If we removed this, we could also use only NUM_ENVP in the allocation
above and kill NUM_EXT_ENVP. Hm.

> And kobject_uevent() can just call kobject_uevent_env(), there is no
> need for the indirection with do_*, right?

OK, may look nicer. I'll respin.

--
Cornelia Huck
Linux for zSeries Developer
Tel.: +49-7031-16-4837, Mail: cornelia.huck@xxxxxxxxxx
-
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/