From: Bjorn Helgaas <helgaas@kernel.org>
To: Qinglang Miao <miaoqinglang@huawei.com>
Cc: Tyrel Datwyler <tyreld@linux.ibm.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Paul Mackerras <paulus@samba.org>,
Bjorn Helgaas <bhelgaas@google.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH -next] PCI: rpadlpar: use for_each_child_of_node() and for_each_node_by_name
Date: Thu, 17 Sep 2020 11:57:23 -0500 [thread overview]
Message-ID: <20200917165723.GA1708462@bjorn-Precision-5520> (raw)
In-Reply-To: <20200916062128.190819-1-miaoqinglang@huawei.com>
On Wed, Sep 16, 2020 at 02:21:28PM +0800, Qinglang Miao wrote:
> Use for_each_child_of_node() and for_each_node_by_name macro
> instead of open coding it.
>
> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Applied to pci/hotplug for v5.10, thanks!
> ---
> drivers/pci/hotplug/rpadlpar_core.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
> index f979b7098..0a3c80ba6 100644
> --- a/drivers/pci/hotplug/rpadlpar_core.c
> +++ b/drivers/pci/hotplug/rpadlpar_core.c
> @@ -40,13 +40,13 @@ static DEFINE_MUTEX(rpadlpar_mutex);
> static struct device_node *find_vio_slot_node(char *drc_name)
> {
> struct device_node *parent = of_find_node_by_name(NULL, "vdevice");
> - struct device_node *dn = NULL;
> + struct device_node *dn;
> int rc;
>
> if (!parent)
> return NULL;
>
> - while ((dn = of_get_next_child(parent, dn))) {
> + for_each_child_of_node(parent, dn) {
> rc = rpaphp_check_drc_props(dn, drc_name, NULL);
> if (rc == 0)
> break;
> @@ -60,10 +60,10 @@ static struct device_node *find_vio_slot_node(char *drc_name)
> static struct device_node *find_php_slot_pci_node(char *drc_name,
> char *drc_type)
> {
> - struct device_node *np = NULL;
> + struct device_node *np;
> int rc;
>
> - while ((np = of_find_node_by_name(np, "pci"))) {
> + for_each_node_by_name(np, "pci") {
> rc = rpaphp_check_drc_props(np, drc_name, drc_type);
> if (rc == 0)
> break;
> --
> 2.23.0
>
prev parent reply other threads:[~2020-09-17 17:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-16 6:21 [PATCH -next] PCI: rpadlpar: use for_each_child_of_node() and for_each_node_by_name Qinglang Miao
2020-09-17 16:57 ` Bjorn Helgaas [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=20200917165723.GA1708462@bjorn-Precision-5520 \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=miaoqinglang@huawei.com \
--cc=paulus@samba.org \
--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