From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36C43C52D6F for ; Thu, 17 Aug 2023 17:10:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353835AbjHQRJ7 (ORCPT ); Thu, 17 Aug 2023 13:09:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353875AbjHQRJo (ORCPT ); Thu, 17 Aug 2023 13:09:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC9A3359C; Thu, 17 Aug 2023 10:09:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 45F39675A3; Thu, 17 Aug 2023 17:09:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD208C43397; Thu, 17 Aug 2023 17:09:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692292176; bh=tr+gP1wBdRSCgmPKKlr0hl197P9Phizogm7powCc/ck=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sOorrPBMF7lDdfdLSDTHK/I+6wSeVQzn8mDmHCDl6sGa2MVBTxLaY2rJM/pBgjY6D tjP6nouIHjzzA4uVpnjFxtrHC7bsb7WAC/zVbsWgowFCoUHGybCVk1dENk1lN07UqE 1z72bRHSUw+QMl0lgKMITdeBy5lFqsMP5wgtoVUv4a9p0wb28eC3t8hxc3u7A7CtN1 er+PL/kk+rYuZqGHE/8VhrGteYbsH6TLoY6dmLYYKuE9hq9yeMWNWXyoXR/0wVfqAF 0oHKaQUq6iWZwrrXUyWYA0LlP2xj4tCJwKSrlsV6/aOfpAu55pVcx+9ngxeHWhEFA7 HsuPVHXa0kyNw== Received: (nullmailer pid 1548189 invoked by uid 1000); Thu, 17 Aug 2023 17:09:34 -0000 Date: Thu, 17 Aug 2023 12:09:34 -0500 From: Rob Herring To: Andy Shevchenko Cc: Frank Rowand , "Enrico Weigelt, metux IT consult" , "Rafael J. Wysocki" , Sakari Ailus , Petr Mladek , Geert Uytterhoeven , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 5/6] of: dynamic: Move dead property list check into property add/update functions Message-ID: <20230817170934.GA1495946-robh@kernel.org> References: <20230801-dt-changeset-fixes-v2-0-c2b701579dee@kernel.org> <20230801-dt-changeset-fixes-v2-5-c2b701579dee@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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