From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C3E7D7346E; Thu, 4 Jul 2024 21:32:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720128735; cv=none; b=DZGw/OcogMQof1U3M+hlIY6X5j6CVY1XLLiEmj75OJ4vNcH67GwiW1Q8fhQ15g8G+XXA0LR330OR5vyKarSVOeeg2a9p7t47Zdes1N8Kw5+CT0kprR4Kqnmi38L02p2yYojUV/pX6wjtUxiYvnbv5yLeeGt0ZrDb0+wz78d0MAI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720128735; c=relaxed/simple; bh=jEOP4tmTJgNwT4VJJ/H4/e/Pm5Ggkrq6iv0SA5dQ8ws=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aEdY1vZXnp4q1ZgWKD8Vx0Yl1lmjGa63OpOWxBKnb1JMPmzahNymJaKTYM9dMXW3sfI3/I92OfBmhKNRocf2tGVCwclQLhO8sRY17opnqDGp/7nA+2sF6W46EPjS0rfT1qULVpw7otozRNkiTDVerLmxMvlGOfheEWGOHH9tEiY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=S0JEVBhI; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="S0JEVBhI" Received: by mail.gandi.net (Postfix) with ESMTPSA id BD86AFF802; Thu, 4 Jul 2024 21:32:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1720128729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Rey18xTlnMgOgIPL25ImB7B15sMWYzxAsvnHNthV5S0=; b=S0JEVBhI3tfc5ntPMObRrKKeyUXsGRrO+dmrSHHiA/CXiaTrDzUnuWN/8RLan/W8yEPBYy WTaC4P67s78ijbrvczP1KnuPtKQbrRcwlYEqUPZPpZW0nhX/siqNP/GhziUB79nYOQPi8r PhP0fpq9va52mSjevxSqg9gaf/S2Ukug9XtKh8mzSUYLpNZp80MAwL96mMkrYY7WNzzmay 5AT/X7DCWHP8tVhsE6o3C1PHb0Q9g3z2DXN4uHMidHU5Rwoaz4Y/LepANuZA6Uuvs21L3L 95mP/Ounvba0aITTStBPv4Esd+fhuzK/5YdBxhSIiG700JAP0NMtF9NGxcnshQ== Date: Thu, 4 Jul 2024 23:31:55 +0200 From: Luca Ceresoli To: Rob Herring Cc: Miguel Ojeda , Saravana Kannan , Nathan Chancellor , Michael Turquette , Stephen Boyd , Tony Lindgren , Bjorn Andersson , Emilio =?UTF-8?Q?L=C3=B3pez?= , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Krzysztof Kozlowski , Daniel Lezcano , Thomas Gleixner , Florian Fainelli , Broadcom internal kernel review list , Linus Walleij , Bartosz Golaszewski , Jonathan Cameron , Lee Jones , Shawn Guo , Pengutronix Kernel Team , Uwe =?UTF-8?Q?Kleine-K=C3=B6nig?= , Greg Kroah-Hartman , Jiri Slaby , Richard Leitner , Liam Girdwood , Mark Brown , Nicolas Ferre , Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Naveen N. Rao" , Damien Le Moal , "Peng Fan (OSS)" , Thomas Petazzoni , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, llvm@lists.linux.dev, linux-clk@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-iio@vger.kernel.org, linux-pwm@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, patches@opensource.cirrus.com, linux-sound@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH 00/20] Simplify of_property_for_each_u32() Message-ID: <20240704233155.61b5323c@booty> In-Reply-To: <20240703180742.GB1245093-robh@kernel.org> References: <20240703-of_property_for_each_u32-v1-0-42c1fc0b82aa@bootlin.com> <20240703180742.GB1245093-robh@kernel.org> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-GND-Sasl: luca.ceresoli@bootlin.com Hello Rob, On Wed, 3 Jul 2024 12:07:42 -0600 Rob Herring wrote: > On Wed, Jul 03, 2024 at 12:36:44PM +0200, Luca Ceresoli wrote: > > [Note: to reduce the noise I have trimmed the get_maintainers list > > manually. Should you want to be removed, or someone else added, to future > > versions, just tell me. Sorry for the noise.] > > > > This series aims at simplifying of_property_for_each_u32() as well as > > making it more difficult to misuse it in the future. > > > > The long-term goal is changing this pattern: > > > > struct property *prop; > > const __be32 *p; > > u32 val; > > > > of_property_for_each_u32(np, "xyz", prop, p, val) { ... } > > > > to this: > > > > u32 val; > > > > of_property_for_each_u32(np, "xyz", val) { ... } > > > > So, removing the 3rd and 4th arguments which are typically meant to be > > internal. Those two parameters used to be unavoidable until the kernel > > moved to building with the C11 standard unconditionally. Since then, it is > > now possible to get rid of them. However a few users of > > of_property_for_each_u32() do actually use those arguments, which > > complicates the transition. For this reason this series does the following: > > > > * Add of_property_for_each_u32_new(), which does not have those two > > arguments (patch 1) > > * Convert _almost_ every usage to of_property_for_each_u32_new() > > * Rename of_property_for_each_u32() to of_property_for_each_u32_old() and > > deprecate it, as a incentive to code not (yet) in mainline to upgrade > > to the *_new() version (last patch) > > I don't really see the point of introducing the _old variant. Let's get > this done in one step. > > > > > The plan for the next series is to additionally: > > > > * Convert the few remaining of_property_for_each_u32_old() instantes to > > of_property_for_each_u32_new() > > * Remove of_property_for_each_u32_old() > > * Rename of_property_for_each_u32_new() to of_property_for_each_u32() > > Honestly, I think there's few enough users we could just convert the > whole thing in one patch. It's all got to go thru 1 tree anyways. If > there's new cases in -next, then I'd be happy to send it to Linus at the > end of the merge window. Sure, make sense. I'll need to convert the few remaining users, then I'm sending a squashed v2. Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 88C7DC3271F for ; Thu, 4 Jul 2024 21:32:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WVOdO4BO7oK13HUNbTXB9dUydgVz4Afu0zuEW0UVcxQ=; b=jf9f2QnX+0DPt5 dTEnVyN47+ysyHcidHsugieu1UaBt995g0dLCE+bCLBIf2JEJbcUQrv3q/YQy9ZO1A7Brsya/uDIJ gt7bHOmrdCuXilBfwdHaLgLv49unSpr16SkiuIaHA7C9+dca07YoD7Dfq1RleSnaP+LMbPQjWWYse P1BD59LTOG2YIP8nAZi8m3ATF5+Xb8d/GO60mB2+hEluQEKvbsZ3Ec9pNemAyOygrEyAVayIYwr72 /STADO54Yr0dRM0yO/b6rsOIEf+mV0ybJ+LlAC9PtUNEJQWSd9czIp993bW7q8+EPHZkMAleRtnAn aXftisXXiI8LP4FsLWpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sPU3w-0000000EQuw-48v8; Thu, 04 Jul 2024 21:32:20 +0000 Received: from relay9-d.mail.gandi.net ([2001:4b98:dc4:8::229]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sPU3s-0000000EQtr-1dN5; Thu, 04 Jul 2024 21:32:18 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id BD86AFF802; Thu, 4 Jul 2024 21:32:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1720128729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Rey18xTlnMgOgIPL25ImB7B15sMWYzxAsvnHNthV5S0=; b=S0JEVBhI3tfc5ntPMObRrKKeyUXsGRrO+dmrSHHiA/CXiaTrDzUnuWN/8RLan/W8yEPBYy WTaC4P67s78ijbrvczP1KnuPtKQbrRcwlYEqUPZPpZW0nhX/siqNP/GhziUB79nYOQPi8r PhP0fpq9va52mSjevxSqg9gaf/S2Ukug9XtKh8mzSUYLpNZp80MAwL96mMkrYY7WNzzmay 5AT/X7DCWHP8tVhsE6o3C1PHb0Q9g3z2DXN4uHMidHU5Rwoaz4Y/LepANuZA6Uuvs21L3L 95mP/Ounvba0aITTStBPv4Esd+fhuzK/5YdBxhSIiG700JAP0NMtF9NGxcnshQ== Date: Thu, 4 Jul 2024 23:31:55 +0200 From: Luca Ceresoli To: Rob Herring Cc: Miguel Ojeda , Saravana Kannan , Nathan Chancellor , Michael Turquette , Stephen Boyd , Tony Lindgren , Bjorn Andersson , Emilio =?UTF-8?Q?L=C3=B3pez?= , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Krzysztof Kozlowski , Daniel Lezcano , Thomas Gleixner , Florian Fainelli , Broadcom internal kernel review list , Linus Walleij , Bartosz Golaszewski , Jonathan Cameron , Lee Jones , Shawn Guo , Pengutronix Kernel Team , Uwe =?UTF-8?Q?Kleine-K=C3=B6nig?= , Greg Kroah-Hartman , Jiri Slaby , Richard Leitner , Liam Girdwood , Mark Brown , Nicolas Ferre , Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Naveen N. Rao" , Damien Le Moal , "Peng Fan (OSS)" , Thomas Petazzoni , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, llvm@lists.linux.dev, linux-clk@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-iio@vger.kernel.org, linux-pwm@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, patches@opensource.cirrus.com, linux-sound@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH 00/20] Simplify of_property_for_each_u32() Message-ID: <20240704233155.61b5323c@booty> In-Reply-To: <20240703180742.GB1245093-robh@kernel.org> References: <20240703-of_property_for_each_u32-v1-0-42c1fc0b82aa@bootlin.com> <20240703180742.GB1245093-robh@kernel.org> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-GND-Sasl: luca.ceresoli@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240704_143216_754211_ABAD456A X-CRM114-Status: GOOD ( 29.92 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Hello Rob, On Wed, 3 Jul 2024 12:07:42 -0600 Rob Herring wrote: > On Wed, Jul 03, 2024 at 12:36:44PM +0200, Luca Ceresoli wrote: > > [Note: to reduce the noise I have trimmed the get_maintainers list > > manually. Should you want to be removed, or someone else added, to future > > versions, just tell me. Sorry for the noise.] > > > > This series aims at simplifying of_property_for_each_u32() as well as > > making it more difficult to misuse it in the future. > > > > The long-term goal is changing this pattern: > > > > struct property *prop; > > const __be32 *p; > > u32 val; > > > > of_property_for_each_u32(np, "xyz", prop, p, val) { ... } > > > > to this: > > > > u32 val; > > > > of_property_for_each_u32(np, "xyz", val) { ... } > > > > So, removing the 3rd and 4th arguments which are typically meant to be > > internal. Those two parameters used to be unavoidable until the kernel > > moved to building with the C11 standard unconditionally. Since then, it is > > now possible to get rid of them. However a few users of > > of_property_for_each_u32() do actually use those arguments, which > > complicates the transition. For this reason this series does the following: > > > > * Add of_property_for_each_u32_new(), which does not have those two > > arguments (patch 1) > > * Convert _almost_ every usage to of_property_for_each_u32_new() > > * Rename of_property_for_each_u32() to of_property_for_each_u32_old() and > > deprecate it, as a incentive to code not (yet) in mainline to upgrade > > to the *_new() version (last patch) > > I don't really see the point of introducing the _old variant. Let's get > this done in one step. > > > > > The plan for the next series is to additionally: > > > > * Convert the few remaining of_property_for_each_u32_old() instantes to > > of_property_for_each_u32_new() > > * Remove of_property_for_each_u32_old() > > * Rename of_property_for_each_u32_new() to of_property_for_each_u32() > > Honestly, I think there's few enough users we could just convert the > whole thing in one patch. It's all got to go thru 1 tree anyways. If > there's new cases in -next, then I'd be happy to send it to Linus at the > end of the merge window. Sure, make sense. I'll need to convert the few remaining users, then I'm sending a squashed v2. Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8ADD5C30653 for ; Thu, 4 Jul 2024 21:33:05 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=gm1 header.b=S0JEVBhI; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4WFVHg6cFqz3cXb for ; Fri, 5 Jul 2024 07:33:03 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=gm1 header.b=S0JEVBhI; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=bootlin.com (client-ip=217.70.183.199; helo=relay9-d.mail.gandi.net; envelope-from=luca.ceresoli@bootlin.com; receiver=lists.ozlabs.org) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4WFVGr5Qrrz3c4W for ; Fri, 5 Jul 2024 07:32:17 +1000 (AEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id BD86AFF802; Thu, 4 Jul 2024 21:32:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1720128729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Rey18xTlnMgOgIPL25ImB7B15sMWYzxAsvnHNthV5S0=; b=S0JEVBhI3tfc5ntPMObRrKKeyUXsGRrO+dmrSHHiA/CXiaTrDzUnuWN/8RLan/W8yEPBYy WTaC4P67s78ijbrvczP1KnuPtKQbrRcwlYEqUPZPpZW0nhX/siqNP/GhziUB79nYOQPi8r PhP0fpq9va52mSjevxSqg9gaf/S2Ukug9XtKh8mzSUYLpNZp80MAwL96mMkrYY7WNzzmay 5AT/X7DCWHP8tVhsE6o3C1PHb0Q9g3z2DXN4uHMidHU5Rwoaz4Y/LepANuZA6Uuvs21L3L 95mP/Ounvba0aITTStBPv4Esd+fhuzK/5YdBxhSIiG700JAP0NMtF9NGxcnshQ== Date: Thu, 4 Jul 2024 23:31:55 +0200 From: Luca Ceresoli To: Rob Herring Subject: Re: [PATCH 00/20] Simplify of_property_for_each_u32() Message-ID: <20240704233155.61b5323c@booty> In-Reply-To: <20240703180742.GB1245093-robh@kernel.org> References: <20240703-of_property_for_each_u32-v1-0-42c1fc0b82aa@bootlin.com> <20240703180742.GB1245093-robh@kernel.org> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-GND-Sasl: luca.ceresoli@bootlin.com X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Leitner , Daniel Lezcano , linux-pwm@vger.kernel.org, Tony Lindgren , Linus Walleij , llvm@lists.linux.dev, Nicolas Ferre , Uwe =?UTF-8?Q?Kleine-K=C3=B6nig?= , Krzysztof Kozlowski , Thomas Petazzoni , linux-riscv@lists.infradead.org, Jiri Slaby , linux-clk@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Florian Fainelli , Samuel Holland , Emilio =?UTF-8?Q?L=C3=B3pez?= , Bartosz Golaszewski , Lee Jones , Jernej Skrabec , linux-iio@vger.kernel.org, Chen-Yu Tsai , Broadcom internal kernel review list , linux-serial@vger.kernel.org, Miguel Ojeda , Michael Turquette , devicetree@vger.kernel.org, "Peng Fan \(OSS\)" , linux-arm-msm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Nicholas Piggin , Nathan Chancellor , "Naveen N. Rao" , Mark Brown , linux-sound@vger.kernel.org, Thomas Gleixner , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Saravana Kannan , linux-gpio@vger.kernel.org, Stephen Boyd , Greg Kroah-Hartman , Bjorn Andersson , linux-usb@vger.kernel.org, Liam Girdwood , linux-kernel@vger.kernel.org, Damien Le Moal , Pengutronix Kernel Team , patches@opensource.cirrus.com, Christophe Leroy , Shawn Guo , linux-sunxi@lists.linux.dev, Jonathan Cameron Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hello Rob, On Wed, 3 Jul 2024 12:07:42 -0600 Rob Herring wrote: > On Wed, Jul 03, 2024 at 12:36:44PM +0200, Luca Ceresoli wrote: > > [Note: to reduce the noise I have trimmed the get_maintainers list > > manually. Should you want to be removed, or someone else added, to future > > versions, just tell me. Sorry for the noise.] > > > > This series aims at simplifying of_property_for_each_u32() as well as > > making it more difficult to misuse it in the future. > > > > The long-term goal is changing this pattern: > > > > struct property *prop; > > const __be32 *p; > > u32 val; > > > > of_property_for_each_u32(np, "xyz", prop, p, val) { ... } > > > > to this: > > > > u32 val; > > > > of_property_for_each_u32(np, "xyz", val) { ... } > > > > So, removing the 3rd and 4th arguments which are typically meant to be > > internal. Those two parameters used to be unavoidable until the kernel > > moved to building with the C11 standard unconditionally. Since then, it is > > now possible to get rid of them. However a few users of > > of_property_for_each_u32() do actually use those arguments, which > > complicates the transition. For this reason this series does the following: > > > > * Add of_property_for_each_u32_new(), which does not have those two > > arguments (patch 1) > > * Convert _almost_ every usage to of_property_for_each_u32_new() > > * Rename of_property_for_each_u32() to of_property_for_each_u32_old() and > > deprecate it, as a incentive to code not (yet) in mainline to upgrade > > to the *_new() version (last patch) > > I don't really see the point of introducing the _old variant. Let's get > this done in one step. > > > > > The plan for the next series is to additionally: > > > > * Convert the few remaining of_property_for_each_u32_old() instantes to > > of_property_for_each_u32_new() > > * Remove of_property_for_each_u32_old() > > * Rename of_property_for_each_u32_new() to of_property_for_each_u32() > > Honestly, I think there's few enough users we could just convert the > whole thing in one patch. It's all got to go thru 1 tree anyways. If > there's new cases in -next, then I'd be happy to send it to Linus at the > end of the merge window. Sure, make sense. I'll need to convert the few remaining users, then I'm sending a squashed v2. Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com