Re: [PATCH 5/9] of: property: implement the .property_get_names() fwnode operation
From: Andy Shevchenko
Date: Tue Nov 10 2026 - 05:58:40 EST
On Tue, Nov 10, 2026 at 11:50 AM Bartosz Golaszewski <brgl@xxxxxxxxxx> wrote:
> On Tue, Nov 10, 2026 at 11:12:02AM +0200, Andy Shevchenko wrote:
> > On Tue, Nov 10, 2026 at 11:00 AM Bartosz Golaszewski <brgl@xxxxxxxxxx> wrote:
> > > On Mon, Nov 09, 2026 at 07:28:33PM +0200, Andy Shevchenko wrote:
> > > > On Mon, Nov 09, 2026 at 02:07:46PM +0100, Bartosz Golaszewski wrote:
> > > > > On Wed, Nov 04, 2026 at 11:21:15PM +0200, Andy Shevchenko wrote:
> > > > > > On Wed, Nov 04, 2026 at 03:03:47PM +0100, Bartosz Golaszewski wrote:
...
> > > PS: is there a way of using match_string() with non-const data?
> >
> > Why? It's an input parameter, it returns an index. Whatever you
> > provide will be not modified.
> What I mean is that the following change
> + ret = match_string(merged, n1, sec_props.array[i]);
> + if (ret >= n1) {
> merged[count++] = sec_props.array[i];
> sec_props.array[i] = NULL;
> }
>
> Results in:
> drivers/base/property.c: In function ‘fwnode_property_get_names’:
> drivers/base/property.c:607:36: error: passing argument 1 of ‘match_string’ from incompatible pointer type [-Wincompatible-pointer-types]
> And I don't see a good way of working around it without doing:
>
> match_string((const char *const)merged, n1, sec_props.array[i]));
>
> which is ugly.
Ah, got it! But why is the "merges" char ** and not char * const *? I
believe that will fix the issue.
--
With Best Regards,
Andy Shevchenko