arm64: make use of for_each_node_by_type()
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 1 Feb 2017 23:01:05 +0000 (15:01 -0800)
committerWill Deacon <will.deacon@arm.com>
Thu, 2 Feb 2017 18:19:27 +0000 (18:19 +0000)
Instead of open-coding the loop, let's use canned macro.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/smp.c

index cb87234cfcf2d2b8ba75f9e83dadf78c927a3e86..a8ec5da530af73987c550ee63eac5e9c91f5d611 100644 (file)
@@ -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)