Skip to content

Commit

Permalink
arm64: Convert to using %pOF instead of full_name
Browse files Browse the repository at this point in the history
Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Will Deacon <will.deacon@arm.com>
  • Loading branch information
Rob Herring authored and Will Deacon committed Jul 20, 2017
1 parent 6f44a0b commit a270f32
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions arch/arm64/kernel/cpu_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ static const char *__init cpu_read_enable_method(int cpu)
* Don't warn spuriously.
*/
if (cpu != 0)
pr_err("%s: missing enable-method property\n",
dn->full_name);
pr_err("%pOF: missing enable-method property\n",
dn);
}
} else {
enable_method = acpi_get_enable_method(cpu);
Expand Down
12 changes: 6 additions & 6 deletions arch/arm64/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ static u64 __init of_get_cpu_mpidr(struct device_node *dn)
*/
cell = of_get_property(dn, "reg", NULL);
if (!cell) {
pr_err("%s: missing reg property\n", dn->full_name);
pr_err("%pOF: missing reg property\n", dn);
return INVALID_HWID;
}

Expand All @@ -478,7 +478,7 @@ static u64 __init of_get_cpu_mpidr(struct device_node *dn)
* Non affinity bits must be set to 0 in the DT
*/
if (hwid & ~MPIDR_HWID_BITMASK) {
pr_err("%s: invalid reg property\n", dn->full_name);
pr_err("%pOF: invalid reg property\n", dn);
return INVALID_HWID;
}
return hwid;
Expand Down Expand Up @@ -627,8 +627,8 @@ static void __init of_parse_and_init_cpus(void)
goto next;

if (is_mpidr_duplicate(cpu_count, hwid)) {
pr_err("%s: duplicate cpu reg properties in the DT\n",
dn->full_name);
pr_err("%pOF: duplicate cpu reg properties in the DT\n",
dn);
goto next;
}

Expand All @@ -640,8 +640,8 @@ static void __init of_parse_and_init_cpus(void)
*/
if (hwid == cpu_logical_map(0)) {
if (bootcpu_valid) {
pr_err("%s: duplicate boot cpu reg property in DT\n",
dn->full_name);
pr_err("%pOF: duplicate boot cpu reg property in DT\n",
dn);
goto next;
}

Expand Down
22 changes: 11 additions & 11 deletions arch/arm64/kernel/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static int __init get_cpu_for_node(struct device_node *node)
}
}

pr_crit("Unable to find CPU node for %s\n", cpu_node->full_name);
pr_crit("Unable to find CPU node for %pOF\n", cpu_node);

of_node_put(cpu_node);
return -1;
Expand All @@ -71,8 +71,8 @@ static int __init parse_core(struct device_node *core, int cluster_id,
cpu_topology[cpu].core_id = core_id;
cpu_topology[cpu].thread_id = i;
} else {
pr_err("%s: Can't get CPU for thread\n",
t->full_name);
pr_err("%pOF: Can't get CPU for thread\n",
t);
of_node_put(t);
return -EINVAL;
}
Expand All @@ -84,15 +84,15 @@ static int __init parse_core(struct device_node *core, int cluster_id,
cpu = get_cpu_for_node(core);
if (cpu >= 0) {
if (!leaf) {
pr_err("%s: Core has both threads and CPU\n",
core->full_name);
pr_err("%pOF: Core has both threads and CPU\n",
core);
return -EINVAL;
}

cpu_topology[cpu].cluster_id = cluster_id;
cpu_topology[cpu].core_id = core_id;
} else if (leaf) {
pr_err("%s: Can't get CPU for leaf core\n", core->full_name);
pr_err("%pOF: Can't get CPU for leaf core\n", core);
return -EINVAL;
}

Expand Down Expand Up @@ -137,17 +137,17 @@ static int __init parse_cluster(struct device_node *cluster, int depth)
has_cores = true;

if (depth == 0) {
pr_err("%s: cpu-map children should be clusters\n",
c->full_name);
pr_err("%pOF: cpu-map children should be clusters\n",
c);
of_node_put(c);
return -EINVAL;
}

if (leaf) {
ret = parse_core(c, cluster_id, core_id++);
} else {
pr_err("%s: Non-leaf cluster with core %s\n",
cluster->full_name, name);
pr_err("%pOF: Non-leaf cluster with core %s\n",
cluster, name);
ret = -EINVAL;
}

Expand All @@ -159,7 +159,7 @@ static int __init parse_cluster(struct device_node *cluster, int depth)
} while (c);

if (leaf && !has_cores)
pr_warn("%s: empty cluster\n", cluster->full_name);
pr_warn("%pOF: empty cluster\n", cluster);

if (leaf)
cluster_id++;
Expand Down

0 comments on commit a270f32

Please sign in to comment.