[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 10 Oct 2022 15:36:17 +0800
From: "Soha Jin" <soha@...u.info>
To: "'Greg Kroah-Hartman'" <gregkh@...uxfoundation.org>,
"'Andy Shevchenko'" <andriy.shevchenko@...ux.intel.com>,
"'Rob Herring'" <robh+dt@...nel.org>
Cc: "'Rafael J. Wysocki'" <rafael@...nel.org>,
"'Daniel Scally'" <djrscally@...il.com>,
"'Heikki Krogerus'" <heikki.krogerus@...ux.intel.com>,
"'Sakari Ailus'" <sakari.ailus@...ux.intel.com>,
<linux-kernel@...r.kernel.org>, <devicetree@...r.kernel.org>
Subject: RE: [PATCH 1/3] string: add match_string_nocase() for case-insensitive match
Hi Greg and Andy,
> From: 'Greg Kroah-Hartman' <gregkh@...uxfoundation.org>
> Sent: Monday, October 10, 2022 2:24 PM
>
> > 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?
My changeset will not break something, and make comparison case-sensitive
does. Some old device firmwares that did not care about letter case might
not function correctly in a newer kernel, because the current kernel checks
compatibility case-insensitively and the former developer did not notice
this with the just working kernel.
> What needs this
> new case-insensitive comparison that does not work today?
> From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Sent: Monday, October 10, 2022 2:24 PM
>
> So, why do we have such in the OF code and do we really need it in the
> modern world?
Frankly speaking, I think case-insensitive comparison is not needed TODAY,
and before I compose this change, I can see codes in kernel like this:
of_device_is_compatible(np, "U4-pcie") ||
of_device_is_compatible(np, "u4-pcie")
which means kernel codes is de facto case-sensitive, although this function
calls `strcasecmp`.
I do not know kernel maintainers' mind when I am composing this change, I
just chose the way which will not break anything. Anyway, I am also glad to
edit the patch to make it case-sensitive once maintainers have made the
final decision.
Regards,
Soha
Powered by blists - more mailing lists