mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jinjie Ruan <ruanjinjie@huawei.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: <andrew@lunn.ch>, <f.fainelli@gmail.com>, <olteanv@gmail.com>,
	<davem@davemloft.net>, <edumazet@google.com>, <pabeni@redhat.com>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next] net: dsa: Simplify with scoped for each OF child loop
Date: Thu, 22 Aug 2024 10:07:25 +0800	[thread overview]
Message-ID: <2d67e112-75a0-3111-3f3a-91e6a982652f@huawei.com> (raw)
In-Reply-To: <20240821171817.3b935a9d@kernel.org>



On 2024/8/22 8:18, Jakub Kicinski wrote:
> On Tue, 20 Aug 2024 14:58:04 +0800 Jinjie Ruan wrote:
>> Use scoped for_each_available_child_of_node_scoped() when iterating over
>> device nodes to make code a bit simpler.
> 
> Could you add more info here that confirms this works with gotos?
> I don't recall the details but I thought sometimes the scoped
> constructs don't do well with gotos. I checked 5 random uses
> of this loop and 4 of them didn't have gotos.

Hi, Jakub

From what I understand, for_each_available_child_of_node_scoped() is not
related to gotos, it only let the iterating child node self-declared and
automatic release, so the of_node_put(iterating_child_node) can be removed.

For example, the following use case has goto and use this macro:

Link:
https://lore.kernel.org/all/20240813-b4-cleanup-h-of-node-put-other-v1-6-cfb67323a95c@linaro.org/


  reply	other threads:[~2024-08-22  2:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-20  6:58 Jinjie Ruan
2024-08-22  0:18 ` Jakub Kicinski
2024-08-22  2:07   ` Jinjie Ruan [this message]
2024-08-22 14:39     ` Krzysztof Kozlowski
2024-08-22 15:05       ` Jakub Kicinski
2024-08-23  2:20       ` Jinjie Ruan
2024-08-22 14:51     ` Jakub Kicinski
2024-08-23  2:22       ` Jinjie Ruan
2024-08-23  6:35       ` Jinjie Ruan
2024-08-25 23:28         ` Andrew Lunn
2024-08-26  3:52           ` Jinjie Ruan

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=2d67e112-75a0-3111-3f3a-91e6a982652f@huawei.com \
    --to=ruanjinjie@huawei.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    /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

all inboxes | Powered by JetHome®