Messages in this thread | ![/](/images/icornerl.gif) | | From | Andy Shevchenko <> | Date | Tue, 21 Mar 2023 09:39:28 +0200 | Subject | Re: [PATCH v2 4/4] pinctrl: s32cc: embed generic struct pingroup and pinfunction |
| |
On Tue, Mar 21, 2023 at 7:09 AM Chester Lin <clin@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@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
| ![\](/images/icornerr.gif) |