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: Tue, 16 Dec 2003 00:21:58 +0000 [thread overview]
Message-ID: <marc-linux-hotplug-107153426702668@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-107152798528161@msgid-missing>
On Mon, Dec 15, 2003 at 02:36:04PM -0800, Greg KH wrote:
> On Fri, Dec 12, 2003 at 08:36:03PM +0100, Kay Sievers wrote:
> > Hi,
> > here is a patch for the namedev-parser not to rely on the order of the
> > fields given in the rule. The error handling now is relaxed, if a field is given
> > twice, the last one wins. If a key is unknown we use it as a sysfs attribute.
> >
> > It is not as efficient as the current version,
> > cause we need to loop over the list of known fields for every given field,
> > but we are free to sort the fields in udev.rules.
> > What do you think?
>
> I like the idea, it really cleans up the code a lot. But it looks like
> it breaks the fact that we might want to test for the sysfs file "name"
> in a rule, right?
Yes, that's not nice. Two options come to my mind:
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.
o switch to case sensitive field name match
and hope nobody puts uppercase 'ID', 'BUS', 'NAME' in the kernel
It's more like a text adventure :)
What do you think?
> > -#define TYPE_LABEL "LABEL"
> > -#define TYPE_NUMBER "NUMBER"
> > -#define TYPE_TOPOLOGY "TOPOLOGY"
> > -#define TYPE_REPLACE "REPLACE"
> > -#define TYPE_CALLOUT "CALLOUT"
>
> Why remove these?
Oh I just wrote the code without it in mind and later simply removed it (being lazy).
The field name strings are also embedded in the code,
we may use #define's for the names of the fields too, then I'm happy :)
thanks,
Kay
-------------------------------------------------------
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\x1278&alloc_id371&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
next prev parent reply other threads:[~2003-12-16 0:21 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 [this message]
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
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-107153426702668@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).