lkml.org 
[lkml]   [2022]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] string: add match_string_nocase() for case-insensitive match
On Mon, Oct 10, 2022 at 11:02:39AM +0800, Soha Jin wrote:
> Hi Greg,
> > On Mon, Oct 10, 2022 at 12:21:53AM +0800, Soha Jin wrote:
> > > Sometimes we want to make a case-insensitive comparison with strings,
> > > like checking compatible devices in fwnode properties, so this commit
> > > abstracts match_string to __match_string with a compare function. The
> > > original match_string will call __match_string with strcmp, and the
> > > new match_string_nocase will call it with strcasecmp.
> >
> > Wait, no, fwnode properties are case sensitive, why are you allowing that to
> > be changed? That sounds like broken firmware to me, right?
> >
>
> I am writing regarding the compatibility. In `of_device_is_compatible`, it
> uses `of_compat_cmp` which calls `strcasecmp` to match compatible property.
>
> As the `fwnode_is_compatible` should be the replacement of the OF way, I
> think we should make the fwnode way and the OF way the same, i.e. either
> both case-insensitive or case-sensitive, to keep the consistency. I am
> afraid that make `of_compat_cmp` case-sensitive may break a great many of
> devices, that is why I am doing this.

Ok, but if you change this with the series, what will break? What needs
this new case-insensitive comparison that does not work today?

thanks,

greg k-h

\
 
 \ /
  Last update: 2022-10-10 08:24    [W:0.113 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site