lkml.org 
[lkml]   [2024]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 11/13] mfd: pm8008: rework driver
On Wed, May 22, 2024 at 10:13:33AM +0300, Andy Shevchenko wrote:
> On Wed, May 22, 2024 at 9:49 AM Johan Hovold <johan@kernel.org> wrote:
> > On Fri, May 10, 2024 at 04:15:43PM +0300, Andy Shevchenko wrote:
> > > On Thu, May 9, 2024 at 12:42 PM Johan Hovold <johan@kernel.org> wrote:
> > > > On Mon, May 06, 2024 at 10:18:58PM +0300, Andy Shevchenko wrote:
> > > > > Mon, May 06, 2024 at 05:08:28PM +0200, Johan Hovold kirjoitti:

> > > > > > +static void devm_irq_domain_fwnode_release(void *res)
> > > > > > +{
> > > > >
> > > > > > + struct fwnode_handle *fwnode = res;
> > > > >
> > > > > Unneeded line, can be
> > > > >
> > > > > static void devm_irq_domain_fwnode_release(void *fwnode)
> > > > >
> > > > > > + irq_domain_free_fwnode(fwnode);
> > > > > > +}
> > > >
> > > > I think I prefer it this way for clarity and for type safety in the
> > > > unlikely even that the argument to irq_domain_free_fwnode() would ever
> > > > change.
> > >
> > > If it ever changes, the allocation part most likely would need an
> > > update and since devm_add_action() takes this type of function, I
> > > don't believe the argument would ever change from void * to something
> > > else. With this it just adds an additional burden on the conversion.
> >
> > I was referring to the irq_domain_free_fwnode() prototype.
>
> And I also referred to that one. The release callback, i.e. the type
> of the parameter, is solely defined by a caller of devm_add_action()
> end friends, and in this case it means that if ever the type changes
> (this is your argument why you want to have explicit line for that,
> necessity of which I oppose) the devm_add_action() arguments also has
> to be changed, it can't be done _just_ there, in
> irq_domain_free_fwnode().

No, not necessarily, but as I already wrote above this is unlikely to
ever be of practical concern.

Johan

\
 
 \ /
  Last update: 2024-05-22 10:00    [W:0.072 / U:1.828 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site