Re: [PATCH v3] gpio: pisosr: Use devm_gpiochip_add_data() to simplify remove path

From: Andy Shevchenko
Date: Tue May 16 2023 - 14:26:56 EST


On Tue, May 16, 2023 at 6:24 PM Andrew Davis <afd@xxxxxx> wrote:
> On 5/15/23 1:34 PM, andy.shevchenko@xxxxxxxxx wrote:

...

> >> +static void pisosr_mutex_destroy(void *data)
> >> +{
> >> + struct mutex *lock = data;
> >> +
> >> + mutex_destroy(lock);
> >> +}
> >
> > No need to cast void * explicitly.
> >
>
> No need sure, but I really think it looks cleaner to be
> explicit with the types here.

The parameter is void * and since it's a simplest wrapper on another
function there is no value to have a clear type. It brings nothing in
my opinion.

> If you feel strongly I
> can change it though.

I would go with less LoCs.

> > static void pisosr_mutex_destroy(void *lock)
> > {
> > mutex_destroy(lock);
> > }

--
With Best Regards,
Andy Shevchenko