* [PATCH -next] sparc: use for_each_child_of_node() macro
@ 2020-07-28 2:28 ` Qinglang Miao
0 siblings, 0 replies; 4+ messages in thread
From: Qinglang Miao @ 2020-07-28 2:28 UTC (permalink / raw)
To: David S. Miller, Greg Kroah-Hartman; +Cc: sparclinux, linux-kernel
Use for_each_child_of_node() macro instead of open coding it.
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
arch/sparc/kernel/pci.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index 5d45b6d76..9c2b720bf 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -552,9 +552,8 @@ static void pci_of_scan_bus(struct pci_pbm_info *pbm,
pci_info(bus, "scan_bus[%pOF] bus no %d\n",
node, bus->number);
- child = NULL;
prev_devfn = -1;
- while ((child = of_get_next_child(node, child)) != NULL) {
+ for_each_child_of_node(node, child) {
if (ofpci_verbose)
pci_info(bus, " * %pOF\n", child);
reg = of_get_property(child, "reg", ®len);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH -next] sparc: use for_each_child_of_node() macro
@ 2020-07-28 2:28 ` Qinglang Miao
0 siblings, 0 replies; 4+ messages in thread
From: Qinglang Miao @ 2020-07-28 2:28 UTC (permalink / raw)
To: David S. Miller, Greg Kroah-Hartman; +Cc: sparclinux, linux-kernel
Use for_each_child_of_node() macro instead of open coding it.
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
arch/sparc/kernel/pci.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index 5d45b6d76..9c2b720bf 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -552,9 +552,8 @@ static void pci_of_scan_bus(struct pci_pbm_info *pbm,
pci_info(bus, "scan_bus[%pOF] bus no %d\n",
node, bus->number);
- child = NULL;
prev_devfn = -1;
- while ((child = of_get_next_child(node, child)) != NULL) {
+ for_each_child_of_node(node, child) {
if (ofpci_verbose)
pci_info(bus, " * %pOF\n", child);
reg = of_get_property(child, "reg", ®len);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH -next] sparc: use for_each_child_of_node() macro
2020-07-28 2:28 ` Qinglang Miao
@ 2020-08-06 0:52 ` David Miller
-1 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-08-06 0:52 UTC (permalink / raw)
To: miaoqinglang; +Cc: gregkh, sparclinux, linux-kernel
aFrom: Qinglang Miao <miaoqinglang@huawei.com>
Date: Tue, 28 Jul 2020 10:28:17 +0800
> Use for_each_child_of_node() macro instead of open coding it.
>
> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Applied, thank you.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] sparc: use for_each_child_of_node() macro
@ 2020-08-06 0:52 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-08-06 0:52 UTC (permalink / raw)
To: miaoqinglang; +Cc: gregkh, sparclinux, linux-kernel
aFrom: Qinglang Miao <miaoqinglang@huawei.com>
Date: Tue, 28 Jul 2020 10:28:17 +0800
> Use for_each_child_of_node() macro instead of open coding it.
>
> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Applied, thank you.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-08-06 0:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-28 2:28 [PATCH -next] sparc: use for_each_child_of_node() macro Qinglang Miao
2020-07-28 2:28 ` Qinglang Miao
2020-08-06 0:52 ` David Miller
2020-08-06 0:52 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.