Skip to contentSkip to conversation

arm64: make use of for_each_node_by_type()

PATCH New Dmitry Torokhov 1 participant 1 message Feb 1, 2017 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: make use of for_each_node_by_type()

Instead of open-coding the loop, let's use canned macro.

---

This will also be needed if I manage to make of_find_node_by_type() stop dropping reference to starting node as it is quite unexpected thing to do.

 arch/arm64/kernel/smp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/kernel/smp.c +2 -2
index cb87234cfcf2..a8ec5da530af 100644
@@ -603,9 +603,9 @@ acpi_parse_gic_cpu_interface(struct acpi_subtable_header *header,
  */
 static void __init of_parse_and_init_cpus(void)
 {
-	struct device_node *dn = NULL;
+	struct device_node *dn;
 
-	while ((dn = of_find_node_by_type(dn, "cpu"))) {
+	for_each_node_by_type(dn, "cpu") {
 		u64 hwid = of_get_cpu_mpidr(dn);
 
 		if (hwid == INVALID_HWID)
Signature · 5 lines
2.11.0.483.g087da7b7c-goog


-- 
Dmitry