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

Segher Boessenkool segher at kernel.crashing.org
Wed Jul 4 08:41:46 EST 2007


>> How about a CONFIG_NOT_BROKEN_DEVICE_TREE that disables this and  
>> other
>> legacy stuff?  If unset, warnings will be printed whenever broken  
>> things
>> are detected.  Boards which need proper device tree parsing can  
>> select
>> the config option.
>>
>> I'd prefer the other way around (CONFIG_BROKEN_DEVICE_TREE), but it'd
>> need to default y at first, and kconfig has no unselect command  
>> that I
>> can see...
>
> What's the value add in doing this?

None.  The kernel should either allow or not allow certain
classes of brokenness; and if it does allow it, it is better
to only allow it in those cases where it expects the brokenness
(i.e., on certain platforms, in this case).

> 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?

There is a big potential harm in not looking at case for the
part of the name before the comma (upper case is stock symbol,
lower case isn't).  An actual real life example?  Dunno, I'm
sure we'll find some if we change to case-sensitive matching.

> Device trees will never be perfect,

But the kernel applies workarounds _way_ too generously.  This
is starting to cause more problems than it solves.

> and it's idiotic of the kernel to
> expect them to be. Even with the dts files, there are several of them
> that have errors in them. There will be more in the future as well.

Sure, especially since the kernel allows all kinds of wrong
things and second guesses what is meant.  Sometimes it guesses
right, and then the device tree is shipped, since "it works so
it must be right".


Segher




More information about the Linuxppc-dev mailing list