From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Wed, 17 Dec 2003 00:50:20 +0000 Subject: Re: [udev] don't rely on field order in namedev_parse MIME-Version: 1 Content-Type: multipart/mixed; boundary="VbJkn9YxBvnuCH5J" Message-Id: List-Id: References: In-Reply-To: To: linux-hotplug@vger.kernel.org --VbJkn9YxBvnuCH5J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Dec 16, 2003 at 03:40:09PM -0800, Greg KH wrote: > On Tue, Dec 16, 2003 at 02:36:25AM +0100, Kay Sievers wrote: > > On Mon, Dec 15, 2003 at 04:27:59PM -0800, Greg KH wrote: > > > On Tue, Dec 16, 2003 at 01:21:58AM +0100, Kay Sievers wrote: > > > > o prepend SYSFS_ to the match, like: > > > > LABEL, BUS="usb", SYSFS_model="Creative Labs WebCam*", NAME="video%n" > > > > This is my favorite. It's close to the current and says clearly what it does. > > > > > > Yeah, I like this one too. > > > > Here is a try. > > Please have a look at it. > > Looks great, it reduced the ammount of code by a bit, making things > easier to read. Nice job. Fine, thanks. Here is a small trivial cleanup of the recent changes. Kay 02-trivial-cleanup-parser-changes.diff o use defines in debug strings o replace my 'xxx' debug :) o shorten line in man page example to not to exceed 80 chars when printed --VbJkn9YxBvnuCH5J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="02-trivial-cleanup-parser-changes.diff" diff -Nru a/namedev_parse.c b/namedev_parse.c --- a/namedev_parse.c Wed Dec 17 01:38:27 2003 +++ b/namedev_parse.c Wed Dec 17 01:38:27 2003 @@ -257,7 +257,7 @@ /* check presence of keys according to method type */ switch (dev.type) { case LABEL: - dbg_parse("LABEL name='%s', bus='%s', " + dbg_parse(TYPE_LABEL " name='%s', bus='%s', " "sysfs_file='%s', sysfs_value='%s', symlink='%s'", dev.name, dev.bus, dev.sysfs_file, dev.sysfs_value, dev.symlink); @@ -268,7 +268,7 @@ goto error; break; case NUMBER: - dbg_parse("NUMBER name='%s', bus='%s', id='%s', symlink='%s'", + dbg_parse(TYPE_NUMBER "name='%s', bus='%s', id='%s', symlink='%s'", dev.name, dev.bus, dev.id, dev.symlink); if ((*dev.name == '\0') || (*dev.bus == '\0') || @@ -276,7 +276,7 @@ goto error; break; case TOPOLOGY: - dbg_parse("TOPOLOGY name='%s', bus='%s', " + dbg_parse(TYPE_TOPOLOGY "name='%s', bus='%s', " "place='%s', symlink='%s'", dev.name, dev.bus, dev.place, dev.symlink); if ((*dev.name == '\0') || @@ -285,14 +285,14 @@ goto error; break; case REPLACE: - dbg_parse("REPLACE name='%s', kernel_name='%s', symlink='%s'", + dbg_parse(TYPE_REPLACE "name='%s', kernel_name='%s', symlink='%s'", dev.name, dev.kernel_name, dev.symlink); if ((*dev.name == '\0') || (*dev.kernel_name == '\0')) goto error; break; case CALLOUT: - dbg_parse("CALLOUT name='%s', bus='%s', program='%s', " + dbg_parse(TYPE_CALLOUT "name='%s', bus='%s', program='%s', " "id='%s', symlink='%s'", dev.name, dev.bus, dev.exec_program, dev.id, dev.symlink); @@ -303,7 +303,7 @@ goto error; break; default: - dbg_parse("xxx default method"); + dbg_parse("unknown type of method"); goto error; } diff -Nru a/udev.8 b/udev.8 --- a/udev.8 Wed Dec 17 01:38:27 2003 +++ b/udev.8 Wed Dec 17 01:38:27 2003 @@ -178,7 +178,7 @@ REPLACE, KERNEL="ttyUSB1", NAME="pda", SYMLINK="palmtop handheld" # multiple USB webcams with symlinks to be called webcam0, webcam1, ... -LABEL, BUS="usb", SYSFS_model="WebCam V3", NAME="video%n", SYMLINK="webcam%n" +LABEL, BUS="usb", SYSFS_model="XV3", NAME="video%n", SYMLINK="webcam%n" .fi .P Permissions and ownership for the created device files may specified at --VbJkn9YxBvnuCH5J-- ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel