Re: [Patch -mm 1/1] driver core: Introduce device_move(): move adevice to a new parent.
From: Kay Sievers
Date: Mon Nov 20 2006 - 09:15:55 EST
On Mon, 2006-11-20 at 13:55 +0100, Cornelia Huck wrote:
> From: Cornelia Huck <cornelia.huck@xxxxxxxxxx>
> Provide a function device_move() to move a device to a new parent device. Add
> auxilliary functions kobject_move() and sysfs_move_dir().
> kobject_move() generates a new uevent of type KOBJ_MOVE, containing the
> previous path (DEVPATH_OLD) in addition to the usual values. For this, a new
> interface kobject_uevent_env() is created that allows to add further
> environmental data to the uevent at the kobject layer.
> +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?
> + /* 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. :)
And kobject_uevent() can just call kobject_uevent_env(), there is no
need for the indirection with do_*, right?
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/