Re: [PATCH v3 5/6] of: dynamic: Move dead property list check into property add/update functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 21, 2023 at 07:24:43AM -0500, Rob Herring wrote:
> On Mon, Aug 21, 2023 at 5:49 AM Andy Shevchenko
> <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > On Fri, Aug 18, 2023 at 03:41:00PM -0500, Rob Herring wrote:

...

> > > v3:
> > >  - Keep existing style in deadprops loop
> >
> > Not sure where exactly in the code that one, but...
> 
> That was your previous comment...

I admit that I haven't heard about cleanup.h that time.

...

> > >  int __of_remove_property(struct device_node *np, struct property *prop)
> > >  {
> > > -     struct property **next;
> > > -
> > > -     for (next = &np->properties; *next; next = &(*next)->next) {
> > > -             if (*next == prop)
> > > -                     break;
> > > +     if (__of_remove_property_from_list(&np->properties, prop)) {
> > > +             /* Found the property, add it to deadprops list */
> > > +             prop->next = np->deadprops;
> > > +             np->deadprops = prop;
> > > +             return 0;
> > >       }
> > > -     if (*next == NULL)
> > > -             return -ENODEV;
> > > -
> > > -     /* found the node */
> > > -     *next = prop->next;
> > > -     prop->next = np->deadprops;
> > > -     np->deadprops = prop;
> > >
> > > -     return 0;
> > > +     return -ENODEV;
> > >  }
> >
> >
> > ...if it's this one, I don't see how it's better than
> >
> >         if (!__of_remove_property_from_list(&np->properties, prop))
> >                 return -ENODEV;
> 
> Because this way doesn't work well when we move the spinlock in here.
> Maybe cleanup.h will help, but I'm not going to do that now. If we do,
> then I'll do it for the whole subsystem/file.

Fair enough.

Although we may also use goto approach in the next patch. Anyway,
I leave it to you for what you think is the best.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux