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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 20 Nov 2006 15:15:03 +0100,
Kay Sievers <[email protected]> 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: [email protected]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux