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

Segher Boessenkool segher at kernel.crashing.org
Wed Jul 4 07:54:20 EST 2007


> 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




More information about the Linuxppc-dev mailing list