[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_JsqJPGh=WvKj9dQbKLOaODjvVXhP4mH+OK_Na5PatDu2OJg@mail.gmail.com>
Date: Thu, 3 Aug 2023 14:42:37 -0600
From: Rob Herring <robh@...nel.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Frank Rowand <frowand.list@...il.com>,
"Enrico Weigelt, metux IT consult" <info@...ux.net>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Petr Mladek <pmladek@...e.com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/5] of: dynamic: Move dead property list check into
property add/update functions
On Wed, Aug 2, 2023 at 9:12 AM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> On Tue, Aug 01, 2023 at 03:54:47PM -0600, Rob Herring wrote:
> > The changeset code checks for a property in the deadprops list when
> > adding/updating a property, but of_add_property() and
> > of_update_property() do not. As the users of these functions are pretty
> > simple, they have not hit this scenario or else the property lists
> > would get corrupted.
>
> ...
>
> Seems like this...
>
> > + /* If the property is in deadprops then it must be removed */
> > + for (next = &np->deadprops; *next; next = &(*next)->next) {
> > + if (*next == prop) {
> > + *next = prop->next;
> > + break;
> > + }
> > + }
>
> > prop->next = NULL;
>
> ...
>
> > + for (next = &np->deadprops; *next; next = &(*next)->next) {
> > + if (*next == newprop) {
> > + *next = newprop->next;
> > + newprop->next = NULL;
> > + break;
> > + }
> > + }
>
> ...is a dup of this. Are you planing to have a helper or at least conditional
> for_each_*() macro for them?
At least the latter would be more clean-up than I want to do here
because this will be backported to stable. We have an iterator for
properties list, but note how this iterates on the "next" ptr address.
So it's a bit different from the normal iterators.
I'll go ahead and add a helper.
Rob
Powered by blists - more mailing lists