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 9FFDFC04E69 for ; Wed, 2 Aug 2023 15:12:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232729AbjHBPMP (ORCPT ); Wed, 2 Aug 2023 11:12:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231788AbjHBPMP (ORCPT ); Wed, 2 Aug 2023 11:12:15 -0400 Received: from mgamail.intel.com (unknown [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4020B2103; Wed, 2 Aug 2023 08:12:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690989134; x=1722525134; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=qjoRO+86zoiQJt1dgEUpx5MbAiDYWWKhC+5c7+9nClw=; b=ZKPZt9IOhG/MRsb4UHb49yS7thrjCL7Jsog5KzYLHsNBJ4qJL1s3E5n9 na5qrY4F+B1Wq3N2wGT8K/EQFkAWhE4z9kKW6pGLpIlsj9t3XTklk1cuE 4cjk/nvWY4Vj10Blr8RXBvdngipBkZLbjOOoZyPvaLgRyuxRvUhhO5t/U qy5d9rFa1TIogx2obnh+V4YjqDlotPtvdfDW4VVSerBX7PAyMATn/g19g 7qV5rPCX1G4QS9WoboYqx6xW+qM/n0a2bI53xw9R2GGVqRjXiOOrsD0Fl tUw0fFMMN9te7T9zSiyTqzEE8DYrf1kW5uLMQl9qi1qeVUehsVtXRy86w A==; X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="367074793" X-IronPort-AV: E=Sophos;i="6.01,249,1684825200"; d="scan'208";a="367074793" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2023 08:12:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="843190688" X-IronPort-AV: E=Sophos;i="6.01,249,1684825200"; d="scan'208";a="843190688" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP; 02 Aug 2023 08:12:11 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qRDWD-003zxb-1Y; Wed, 02 Aug 2023 18:12:09 +0300 Date: Wed, 2 Aug 2023 18:12:09 +0300 From: Andy Shevchenko To: Rob Herring 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 4/5] of: dynamic: Move dead property list check into property add/update functions Message-ID: References: <20230801-dt-changeset-fixes-v1-0-b5203e3fc22f@kernel.org> <20230801-dt-changeset-fixes-v1-4-b5203e3fc22f@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230801-dt-changeset-fixes-v1-4-b5203e3fc22f@kernel.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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? -- With Best Regards, Andy Shevchenko