Skip to content

Commit

Permalink
powerpc/numa: convert printk to pr_xxx
Browse files Browse the repository at this point in the history
Convert the remaining printk to pr_xxx
One advantage would be all prints will now have prefix "numa:" from
pr_fmt().

[ convert printk(KERN_ERR) to pr_warn : Suggested by Laurent Dufour ]
Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
[mpe: Rebase onto powerpc/next, s/WARNING/Warning/]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210826100521.412639-3-srikar@linux.vnet.ibm.com
  • Loading branch information
Srikar Dronamraju authored and Michael Ellerman committed Aug 26, 2021
1 parent 544af64 commit 506c207
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions arch/powerpc/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ static void unmap_cpu_from_node(unsigned long cpu)
if (cpumask_test_cpu(cpu, node_to_cpumask_map[node])) {
cpumask_clear_cpu(cpu, node_to_cpumask_map[node]);
} else {
printk(KERN_ERR "WARNING: cpu %lu not found in node %d\n",
cpu, node);
pr_warn("Warning: cpu %lu not found in node %d\n", cpu, node);
}
}
#endif /* CONFIG_HOTPLUG_CPU || CONFIG_PPC_SPLPAR */
Expand Down Expand Up @@ -479,15 +478,14 @@ static int __init find_primary_domain_index(void)
&distance_ref_points_depth);

if (!distance_ref_points) {
pr_debug("NUMA: ibm,associativity-reference-points not found.\n");
pr_debug("ibm,associativity-reference-points not found.\n");
goto err;
}

distance_ref_points_depth /= sizeof(int);
if (affinity_form == FORM0_AFFINITY) {
if (distance_ref_points_depth < 2) {
printk(KERN_WARNING "NUMA: "
"short ibm,associativity-reference-points\n");
pr_warn("short ibm,associativity-reference-points\n");
goto err;
}

Expand All @@ -504,8 +502,8 @@ static int __init find_primary_domain_index(void)
* MAX_DISTANCE_REF_POINTS domains.
*/
if (distance_ref_points_depth > MAX_DISTANCE_REF_POINTS) {
printk(KERN_WARNING "NUMA: distance array capped at "
"%d entries\n", MAX_DISTANCE_REF_POINTS);
pr_warn("distance array capped at %d entries\n",
MAX_DISTANCE_REF_POINTS);
distance_ref_points_depth = MAX_DISTANCE_REF_POINTS;
}

Expand Down Expand Up @@ -910,7 +908,7 @@ static int __init parse_numa_properties(void)
const __be32 *associativity;

if (numa_enabled == 0) {
printk(KERN_WARNING "NUMA disabled by user\n");
pr_warn("disabled by user\n");
return -1;
}

Expand All @@ -925,7 +923,7 @@ static int __init parse_numa_properties(void)
return primary_domain_index;
}

pr_debug("NUMA associativity depth for CPU/Memory: %d\n", primary_domain_index);
pr_debug("associativity depth for CPU/Memory: %d\n", primary_domain_index);

/*
* If it is FORM2 initialize the distance table here.
Expand Down Expand Up @@ -1038,10 +1036,8 @@ static void __init setup_nonnuma(void)
unsigned int nid = 0;
int i;

printk(KERN_DEBUG "Top of RAM: 0x%lx, Total RAM: 0x%lx\n",
top_of_ram, total_ram);
printk(KERN_DEBUG "Memory hole size: %ldMB\n",
(top_of_ram - total_ram) >> 20);
pr_debug("Top of RAM: 0x%lx, Total RAM: 0x%lx\n", top_of_ram, total_ram);
pr_debug("Memory hole size: %ldMB\n", (top_of_ram - total_ram) >> 20);

for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, NULL) {
fake_numa_create_new_node(end_pfn, &nid);
Expand Down

0 comments on commit 506c207

Please sign in to comment.