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

Segher Boessenkool segher at
Wed Jul 4 08:52:04 EST 2007

>> What's the value add in doing this? The code to handle both cases  
>> still
>> has to be in there (just under ifdef now). Is there actually any harm
>> in doing case-insensitive matching today, where things break because
>> there are conflicting properties with different cases?
> Not for case insensitivity (that I know of), but the whole reason I  
> posted this was because of time spent trying to figure out why my  
> serial port recently stopped working -- apparently, it's checking  
> nodes in a different order now (or something along those lines),  
> causing the substring match to match against the wrong thing.

Substring matching is WRONG WRONG WRONG.

> It's even more idiotic to break valid device trees just because the  
> kernel has always done so.  Putting it under ifdef, especially once  
> the default is conformant behavior, will make it more likely that  
> future device trees are compliant in that regrad, as long as Linux  
> is involved in the testing process.

We should just implement *targeted* workarounds, not say
"oh, some trees use bad upper/lower casing?  Let's just match
case-insensitive then".

>> Even with the dts files, there are several of them
>> that have errors in them. There will be more in the future as well.
> And the earlier we implement stricter checking, the fewer of them  
> there will be.

Yes, unfortunately.


More information about the Linuxppc-dev mailing list