Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
To: Jonathan Cameron <jonathan.cameron@huawei.com>
Cc: Damien Le Moal <dlemoal@kernel.org>,
	Niklas Cassel <cassel@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
	imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH 1/3] ata: ahci-dwc: Simplify with scoped for each OF child loop
Date: Mon, 5 Jan 2026 14:05:30 +0100	[thread overview]
Message-ID: <3ca74ed7-fe54-4ddd-b0ab-5f9eb56e6a09@oss.qualcomm.com> (raw)
In-Reply-To: <20260105105252.00003b5a@huawei.com>

On 05/01/2026 11:52, Jonathan Cameron wrote:
> On Fri,  2 Jan 2026 13:50:41 +0100
> Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> wrote:
> 
>> Use scoped for-each loop when iterating over device nodes to make code a
>> bit simpler.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> 
> A whilst you are here suggestion inline to make it a bit simpler.
> 
>> ---
>>  drivers/ata/ahci_dwc.c | 7 ++-----
>>  1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/ata/ahci_dwc.c b/drivers/ata/ahci_dwc.c
>> index aec6d793f51a..bfd24772ee67 100644
>> --- a/drivers/ata/ahci_dwc.c
>> +++ b/drivers/ata/ahci_dwc.c
>> @@ -260,7 +260,6 @@ static void ahci_dwc_init_timer(struct ahci_host_priv *hpriv)
>>  static int ahci_dwc_init_dmacr(struct ahci_host_priv *hpriv)
>>  {
>>  	struct ahci_dwc_host_priv *dpriv = hpriv->plat_data;
>> -	struct device_node *child;
>>  	void __iomem *port_mmio;
>>  	u32 port, dmacr, ts;
>>  
>> @@ -271,14 +270,12 @@ static int ahci_dwc_init_dmacr(struct ahci_host_priv *hpriv)
>>  	 * the HBA global reset so we can freely initialize it once until the
>>  	 * next system reset.
>>  	 */
>> -	for_each_child_of_node(dpriv->pdev->dev.of_node, child) {
>> +	for_each_child_of_node_scoped(dpriv->pdev->dev.of_node, child) {
>>  		if (!of_device_is_available(child))
> 
> for_each_available_child_of_node_scoped()?

Huh, indeed I did not notice it. Thanks!



Best regards,
Krzysztof

      reply	other threads:[~2026-01-05 13:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-02 12:50 [PATCH 1/3] ata: ahci-dwc: Simplify with scoped for each OF child loop Krzysztof Kozlowski
2026-01-02 12:50 ` [PATCH 2/3] ata: ahci-imx: Fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
2026-01-02 12:50 ` [PATCH 3/3] ata: ahci-xgene: " Krzysztof Kozlowski
2026-01-05 10:52 ` [PATCH 1/3] ata: ahci-dwc: Simplify with scoped for each OF child loop Jonathan Cameron
2026-01-05 13:05   ` Krzysztof Kozlowski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3ca74ed7-fe54-4ddd-b0ab-5f9eb56e6a09@oss.qualcomm.com \
    --to=krzysztof.kozlowski@oss.qualcomm.com \
    --cc=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=jonathan.cameron@huawei.com \
    --cc=justinstitt@google.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=nick.desaulniers+lkml@gmail.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox