[PATCH v2 4/4] pinctrl: s32cc: embed generic struct pingroup and pinfunction

Andy Shevchenko andy.shevchenko at gmail.com
Tue Mar 21 00:39:28 PDT 2023


On Tue, Mar 21, 2023 at 7:09 AM Chester Lin <clin at suse.com> wrote:
> On Mon, Mar 20, 2023 at 07:10:40PM +0200, Andy Shevchenko wrote:
> > On Mon, Mar 20, 2023 at 6:39 PM Chester Lin <clin at suse.com> wrote:

...

> > >         for_each_child_of_node(np, child) {
> > > -               func->groups[i] = child->name;
> > > +               groups[i] = (char *)child->name;

Here is also questionable casting.

...

> > > +       func->groups = (const char **)groups;
> >
> > Hmm... Why is casting needed?
>
> It's used for fulfilling the type checking done by kbuild otherwise an error will occur:
>
> drivers/pinctrl/nxp/pinctrl-s32cc.c:815:22: error: assignment to 'const char * const*' from incompatible pointer type 'char **' [-Werror=incompatible-pointer-types]
>
> In 'struct pinfunction', the member 'groups' is declared as (const char * const *).

So, please decouple `struct pingroup` change to a separate patch and
hence `struct pinfunction` on its own.

After, consider changing types elsewhere that are following the types
in that data structures.

-- 
With Best Regards,
Andy Shevchenko



More information about the linux-arm-kernel mailing list