Skip to content

Commit f11c7ba

Browse files
Kefeng Wangwildea01
authored andcommitted
arm64: numa: Use pr_fmt()
Use pr_fmt to prefix kernel output, and remove duplicated msg of NUMA turned off. Signed-off-by: Kefeng Wang <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent ad02180 commit f11c7ba

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

arch/arm64/mm/numa.c

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
*/
1919

20+
#define pr_fmt(fmt) "NUMA: " fmt
21+
2022
#include <linux/acpi.h>
2123
#include <linux/bootmem.h>
2224
#include <linux/memblock.h>
@@ -38,10 +40,9 @@ static __init int numa_parse_early_param(char *opt)
3840
{
3941
if (!opt)
4042
return -EINVAL;
41-
if (!strncmp(opt, "off", 3)) {
42-
pr_info("%s\n", "NUMA turned off");
43+
if (!strncmp(opt, "off", 3))
4344
numa_off = true;
44-
}
45+
4546
return 0;
4647
}
4748
early_param("numa", numa_parse_early_param);
@@ -110,7 +111,7 @@ static void __init setup_node_to_cpumask_map(void)
110111
set_cpu_numa_node(cpu, NUMA_NO_NODE);
111112

112113
/* cpumask_of_node() will now work */
113-
pr_debug("NUMA: Node to cpumask map for %d nodes\n", nr_node_ids);
114+
pr_debug("Node to cpumask map for %d nodes\n", nr_node_ids);
114115
}
115116

116117
/*
@@ -145,13 +146,13 @@ int __init numa_add_memblk(int nid, u64 start, u64 end)
145146

146147
ret = memblock_set_node(start, (end - start), &memblock.memory, nid);
147148
if (ret < 0) {
148-
pr_err("NUMA: memblock [0x%llx - 0x%llx] failed to add on node %d\n",
149+
pr_err("memblock [0x%llx - 0x%llx] failed to add on node %d\n",
149150
start, (end - 1), nid);
150151
return ret;
151152
}
152153

153154
node_set(nid, numa_nodes_parsed);
154-
pr_info("NUMA: Adding memblock [0x%llx - 0x%llx] on node %d\n",
155+
pr_info("Adding memblock [0x%llx - 0x%llx] on node %d\n",
155156
start, (end - 1), nid);
156157
return ret;
157158
}
@@ -166,19 +167,18 @@ static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn)
166167
void *nd;
167168
int tnid;
168169

169-
pr_info("NUMA: Initmem setup node %d [mem %#010Lx-%#010Lx]\n",
170-
nid, start_pfn << PAGE_SHIFT,
171-
(end_pfn << PAGE_SHIFT) - 1);
170+
pr_info("Initmem setup node %d [mem %#010Lx-%#010Lx]\n",
171+
nid, start_pfn << PAGE_SHIFT, (end_pfn << PAGE_SHIFT) - 1);
172172

173173
nd_pa = memblock_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid);
174174
nd = __va(nd_pa);
175175

176176
/* report and initialize */
177-
pr_info("NUMA: NODE_DATA [mem %#010Lx-%#010Lx]\n",
177+
pr_info("NODE_DATA [mem %#010Lx-%#010Lx]\n",
178178
nd_pa, nd_pa + nd_size - 1);
179179
tnid = early_pfn_to_nid(nd_pa >> PAGE_SHIFT);
180180
if (tnid != nid)
181-
pr_info("NUMA: NODE_DATA(%d) on node %d\n", nid, tnid);
181+
pr_info("NODE_DATA(%d) on node %d\n", nid, tnid);
182182

183183
node_data[nid] = nd;
184184
memset(NODE_DATA(nid), 0, sizeof(pg_data_t));
@@ -235,8 +235,7 @@ static int __init numa_alloc_distance(void)
235235
numa_distance[i * numa_distance_cnt + j] = i == j ?
236236
LOCAL_DISTANCE : REMOTE_DISTANCE;
237237

238-
pr_debug("NUMA: Initialized distance table, cnt=%d\n",
239-
numa_distance_cnt);
238+
pr_debug("Initialized distance table, cnt=%d\n", numa_distance_cnt);
240239

241240
return 0;
242241
}
@@ -257,20 +256,20 @@ static int __init numa_alloc_distance(void)
257256
void __init numa_set_distance(int from, int to, int distance)
258257
{
259258
if (!numa_distance) {
260-
pr_warn_once("NUMA: Warning: distance table not allocated yet\n");
259+
pr_warn_once("Warning: distance table not allocated yet\n");
261260
return;
262261
}
263262

264263
if (from >= numa_distance_cnt || to >= numa_distance_cnt ||
265264
from < 0 || to < 0) {
266-
pr_warn_once("NUMA: Warning: node ids are out of bound, from=%d to=%d distance=%d\n",
265+
pr_warn_once("Warning: node ids are out of bound, from=%d to=%d distance=%d\n",
267266
from, to, distance);
268267
return;
269268
}
270269

271270
if ((u8)distance != distance ||
272271
(from == to && distance != LOCAL_DISTANCE)) {
273-
pr_warn_once("NUMA: Warning: invalid distance parameter, from=%d to=%d distance=%d\n",
272+
pr_warn_once("Warning: invalid distance parameter, from=%d to=%d distance=%d\n",
274273
from, to, distance);
275274
return;
276275
}
@@ -297,7 +296,7 @@ static int __init numa_register_nodes(void)
297296
/* Check that valid nid is set to memblks */
298297
for_each_memblock(memory, mblk)
299298
if (mblk->nid == NUMA_NO_NODE || mblk->nid >= MAX_NUMNODES) {
300-
pr_warn("NUMA: Warning: invalid memblk node %d [mem %#010Lx-%#010Lx]\n",
299+
pr_warn("Warning: invalid memblk node %d [mem %#010Lx-%#010Lx]\n",
301300
mblk->nid, mblk->base,
302301
mblk->base + mblk->size - 1);
303302
return -EINVAL;
@@ -369,8 +368,8 @@ static int __init dummy_numa_init(void)
369368

370369
if (numa_off)
371370
pr_info("NUMA disabled\n"); /* Forced off on command line. */
372-
pr_info("NUMA: Faking a node at [mem %#018Lx-%#018Lx]\n",
373-
0LLU, PFN_PHYS(max_pfn) - 1);
371+
pr_info("Faking a node at [mem %#018Lx-%#018Lx]\n",
372+
0LLU, PFN_PHYS(max_pfn) - 1);
374373

375374
for_each_memblock(memory, mblk) {
376375
ret = numa_add_memblk(0, mblk->base, mblk->base + mblk->size);

0 commit comments

Comments
 (0)