linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: [udev] don't rely on field order in namedev_parse
Date: Wed, 17 Dec 2003 00:50:20 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-107162226623416@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-107152798528161@msgid-missing>

[-- Attachment #1: Type: text/plain, Size: 914 bytes --]

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


[-- Attachment #2: 02-trivial-cleanup-parser-changes.diff --]
[-- Type: text/plain, Size: 2338 bytes --]

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

  parent reply	other threads:[~2003-12-17  0:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-15 22:36 [udev] don't rely on field order in namedev_parse Greg KH
2003-12-16  0:21 ` Kay Sievers
2003-12-16  0:27 ` Greg KH
2003-12-16  1:36 ` Kay Sievers
2003-12-16 23:40 ` Greg KH
2003-12-17  0:50 ` Kay Sievers [this message]
2003-12-17  0:59 ` Greg KH
2003-12-17 17:04 ` Roman Kagan
2003-12-17 18:26 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2003-12-12 19:36 Kay Sievers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-hotplug-107162226623416@msgid-missing \
    --to=kay.sievers@vrfy.org \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).