Thread (9 messages) flat view 9 messages, 4 authors, 2007-07-04

Re: Should of_device_is_compatible() use strcmp() rather than strncasecmp()?

From: Segher Boessenkool <hidden>
Date: 2007-07-03 21:54:31

Is there any particular reason that of_device_is_compatible uses
strncasecmp()?
It always has, so some things might break with certain
device trees when we make the matching more strict/correct.
Besides the OF spec saying that names (and thus
compatibles) are case sensitive, the "n" part screws up matching  
when a
subset of a string is not a more generic version thereof.  For  
example,
ucc_geth v. ucc_geth_phy, or fsl,cpm v. fsl,cpm-enet.
Huh?  Are you saying things are matching on substrings?
That's even more wrong!
Does anything actually rely on this behavior?
Yeah I'm pretty sure some things do.  Those are bugs that
need fixing.  My plan was to print a big fat warning whenever
a case-insensitive match wouldn't match when following the
rules; I never got around to actually implementing that though.
Maybe some day ;-)


Segher
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help