Should of_device_is_compatible() use strcmp() rather than strncasecmp()?
Paul Mackerras
paulus at samba.org
Wed Jul 4 13:28:27 EST 2007
Scott Wood writes:
> Is there any particular reason that of_device_is_compatible uses
> strncasecmp()? 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.
>
> Does anything actually rely on this behavior?
Things did in the past rely on the case-insensitive comparison but
probably don't any more. I recall an issue with "ata" vs. "ATA" on
the powerbook 3400.
As for the "n" part, I don't recall exactly why that was done. I
think we should change it to use strcmp and fix any drivers that
break.
Paul.
More information about the Linuxppc-dev
mailing list