Re: [PATCH v2 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 07, 2023 at 06:37:15PM +0300, Andy Shevchenko wrote:
> On Fri, Aug 04, 2023 at 04:41:55PM -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.
> 
> Suggested-by: ? :-)

Humm, by me? The change in behavior and point of this patch comes from 
me. You've provided review comments which will get covered by a
Reviewed-by I presume.

> 
> ...
> 
> > +static void __of_remove_dead_property(struct device_node *np, struct property *prop)
> > +{
> > +	struct property **next;
> > +
> > +	/* If the property is in deadprops then it must be removed */
> > +	for (next = &np->deadprops; *next; next = &(*next)->next) {
> > +		if (*next != prop)
> > +			continue;
> > +
> > +		*next = prop->next;
> > +		prop->next = NULL;
> > +		break;
> 
> Why not
> 
> 		if (*next == prop) {
> 			*next = prop->next;
> 			prop->next = NULL;
> 			break;
> 		}
> 
> which seems to me clearer?

Sure. I like the style I wrote, but whichever way ends the discussion is 
fine for me.

Rob



[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