From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Cc: "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Pali Rohár" <pali@kernel.org>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Madhavan Srinivasan" <maddy@linux.ibm.com>,
"Michael Ellerman" <mpe@ellerman.id.au>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
"Tyrel Datwyler" <tyreld@linux.ibm.com>,
linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
LKML <linux-kernel@vger.kernel.org>,
linuxppc-dev@lists.ozlabs.org,
"Jonathan Cameron" <jonathan.cameron@huawei.com>
Subject: Re: [PATCH v2 3/4] PCI: pnv_php: Simplify with scoped for each OF child loop
Date: Tue, 17 Mar 2026 17:25:57 +0200 (EET) [thread overview]
Message-ID: <f4a8c26d-99ee-2f12-ddcf-cda2aaf0cf5b@linux.intel.com> (raw)
In-Reply-To: <20260317133322.266102-7-krzysztof.kozlowski@oss.qualcomm.com>
[-- Attachment #1: Type: text/plain, Size: 1520 bytes --]
On Tue, 17 Mar 2026, Krzysztof Kozlowski wrote:
> Use scoped for-each loop when iterating over device nodes to make code a
> bit simpler.
>
> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
>
> ---
>
> Changes in v2:
> Tags
> ---
> drivers/pci/hotplug/pnv_php.c | 19 +++++++------------
> 1 file changed, 7 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c
> index 5c020831e318..ff92a5c301b8 100644
> --- a/drivers/pci/hotplug/pnv_php.c
> +++ b/drivers/pci/hotplug/pnv_php.c
> @@ -215,24 +215,19 @@ static void pnv_php_reverse_nodes(struct device_node *parent)
> static int pnv_php_populate_changeset(struct of_changeset *ocs,
> struct device_node *dn)
> {
> - struct device_node *child;
> - int ret = 0;
> + int ret;
>
> - for_each_child_of_node(dn, child) {
> + for_each_child_of_node_scoped(dn, child) {
> ret = of_changeset_attach_node(ocs, child);
> - if (ret) {
> - of_node_put(child);
> - break;
> - }
> + if (ret)
> + return ret;
>
> ret = pnv_php_populate_changeset(ocs, child);
> - if (ret) {
> - of_node_put(child);
> - break;
> - }
> + if (ret)
> + return ret;
> }
>
> - return ret;
> + return 0;
> }
>
> static void *pnv_php_add_one_pdn(struct device_node *dn, void *data)
>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
--
i.
next prev parent reply other threads:[~2026-03-17 15:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-17 13:33 [PATCH v2 1/4] PCI: mvebu: Simplify with scoped for each OF child loop Krzysztof Kozlowski
2026-03-17 13:33 ` [PATCH v2 2/4] PCI: mvebu: Keep child node refcnt for probe duration Krzysztof Kozlowski
2026-03-17 13:33 ` [PATCH v2 3/4] PCI: pnv_php: Simplify with scoped for each OF child loop Krzysztof Kozlowski
2026-03-17 15:25 ` Ilpo Järvinen [this message]
2026-03-17 21:20 ` Bjorn Helgaas
2026-03-17 13:33 ` [PATCH v2 4/4] PCI: rpaphp: " Krzysztof Kozlowski
2026-03-17 15:26 ` Ilpo Järvinen
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=f4a8c26d-99ee-2f12-ddcf-cda2aaf0cf5b@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=chleroy@kernel.org \
--cc=jonathan.cameron@huawei.com \
--cc=krzysztof.kozlowski@oss.qualcomm.com \
--cc=kwilczynski@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lpieralisi@kernel.org \
--cc=maddy@linux.ibm.com \
--cc=mani@kernel.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=pali@kernel.org \
--cc=robh@kernel.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=tyreld@linux.ibm.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