Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934176AbWKTOPX (ORCPT ); Mon, 20 Nov 2006 09:15:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S934178AbWKTOPW (ORCPT ); Mon, 20 Nov 2006 09:15:22 -0500 Received: from moutng.kundenserver.de ([212.227.126.186]:6869 "EHLO moutng.kundenserver.de") by vger.kernel.org with ESMTP id S934176AbWKTOPU (ORCPT ); Mon, 20 Nov 2006 09:15:20 -0500 Subject: Re: [Patch -mm 1/1] driver core: Introduce device_move(): move a device to a new parent. From: Kay Sievers To: Cornelia Huck Cc: Greg KH , linux-kernel , Andrew Morton , Martin Schwidefsky In-Reply-To: <20061120135515.38298bf5@gondolin.boeblingen.de.ibm.com> References: <20061116154210.217f2e04@gondolin.boeblingen.de.ibm.com> <1163695657.7900.9.camel@min.off.vrfy.org> <20061117042338.GA11131@kroah.com> <20061120090537.6d59dbc5@gondolin.boeblingen.de.ibm.com> <20061120135515.38298bf5@gondolin.boeblingen.de.ibm.com> Content-Type: text/plain Date: Mon, 20 Nov 2006 15:15:03 +0100 Message-Id: <1164032103.5541.12.camel@min.off.vrfy.org> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1 Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de abuse@kundenserver.de login:4ddcc9dd12ba6cf3155e4d81b383efda Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1304 Lines: 35 On Mon, 2006-11-20 at 13:55 +0100, Cornelia Huck wrote: > From: Cornelia Huck > > 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? Thanks, Kay - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/