aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/setup_percpu.c8
-rw-r--r--include/asm-generic/topology.h3
-rw-r--r--include/asm-x86/topology.h10
3 files changed, 11 insertions, 10 deletions
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 5fc310f746fc..cac68430d31f 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -343,23 +343,23 @@ static const cpumask_t cpu_mask_none;
343/* 343/*
344 * Returns a pointer to the bitmask of CPUs on Node 'node'. 344 * Returns a pointer to the bitmask of CPUs on Node 'node'.
345 */ 345 */
346cpumask_t *_node_to_cpumask_ptr(int node) 346const cpumask_t *_node_to_cpumask_ptr(int node)
347{ 347{
348 if (node_to_cpumask_map == NULL) { 348 if (node_to_cpumask_map == NULL) {
349 printk(KERN_WARNING 349 printk(KERN_WARNING
350 "_node_to_cpumask_ptr(%d): no node_to_cpumask_map!\n", 350 "_node_to_cpumask_ptr(%d): no node_to_cpumask_map!\n",
351 node); 351 node);
352 dump_stack(); 352 dump_stack();
353 return &cpu_online_map; 353 return (const cpumask_t *)&cpu_online_map;
354 } 354 }
355 if (node >= nr_node_ids) { 355 if (node >= nr_node_ids) {
356 printk(KERN_WARNING 356 printk(KERN_WARNING
357 "_node_to_cpumask_ptr(%d): node > nr_node_ids(%d)\n", 357 "_node_to_cpumask_ptr(%d): node > nr_node_ids(%d)\n",
358 node, nr_node_ids); 358 node, nr_node_ids);
359 dump_stack(); 359 dump_stack();
360 return (cpumask_t *)&cpu_mask_none; 360 return &cpu_mask_none;
361 } 361 }
362 return (cpumask_t *)&node_to_cpumask_map[node]; 362 return &node_to_cpumask_map[node];
363} 363}
364EXPORT_SYMBOL(_node_to_cpumask_ptr); 364EXPORT_SYMBOL(_node_to_cpumask_ptr);
365 365
diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h
index a6aea79bca4f..54bbf6e04ee8 100644
--- a/include/asm-generic/topology.h
+++ b/include/asm-generic/topology.h
@@ -60,7 +60,8 @@
60#ifndef node_to_cpumask_ptr 60#ifndef node_to_cpumask_ptr
61 61
62#define node_to_cpumask_ptr(v, node) \ 62#define node_to_cpumask_ptr(v, node) \
63 cpumask_t _##v = node_to_cpumask(node), *v = &_##v 63 cpumask_t _##v = node_to_cpumask(node); \
64 const cpumask_t *v = &_##v
64 65
65#define node_to_cpumask_ptr_next(v, node) \ 66#define node_to_cpumask_ptr_next(v, node) \
66 _##v = node_to_cpumask(node) 67 _##v = node_to_cpumask(node)
diff --git a/include/asm-x86/topology.h b/include/asm-x86/topology.h
index 98e5f17ea856..90ac7718469a 100644
--- a/include/asm-x86/topology.h
+++ b/include/asm-x86/topology.h
@@ -82,7 +82,7 @@ DECLARE_EARLY_PER_CPU(int, x86_cpu_to_node_map);
82#ifdef CONFIG_DEBUG_PER_CPU_MAPS 82#ifdef CONFIG_DEBUG_PER_CPU_MAPS
83extern int cpu_to_node(int cpu); 83extern int cpu_to_node(int cpu);
84extern int early_cpu_to_node(int cpu); 84extern int early_cpu_to_node(int cpu);
85extern cpumask_t *_node_to_cpumask_ptr(int node); 85extern const cpumask_t *_node_to_cpumask_ptr(int node);
86extern cpumask_t node_to_cpumask(int node); 86extern cpumask_t node_to_cpumask(int node);
87 87
88#else /* !CONFIG_DEBUG_PER_CPU_MAPS */ 88#else /* !CONFIG_DEBUG_PER_CPU_MAPS */
@@ -103,7 +103,7 @@ static inline int early_cpu_to_node(int cpu)
103} 103}
104 104
105/* Returns a pointer to the cpumask of CPUs on Node 'node'. */ 105/* Returns a pointer to the cpumask of CPUs on Node 'node'. */
106static inline cpumask_t *_node_to_cpumask_ptr(int node) 106static inline const cpumask_t *_node_to_cpumask_ptr(int node)
107{ 107{
108 return &node_to_cpumask_map[node]; 108 return &node_to_cpumask_map[node];
109} 109}
@@ -118,7 +118,7 @@ static inline cpumask_t node_to_cpumask(int node)
118 118
119/* Replace default node_to_cpumask_ptr with optimized version */ 119/* Replace default node_to_cpumask_ptr with optimized version */
120#define node_to_cpumask_ptr(v, node) \ 120#define node_to_cpumask_ptr(v, node) \
121 cpumask_t *v = _node_to_cpumask_ptr(node) 121 const cpumask_t *v = _node_to_cpumask_ptr(node)
122 122
123#define node_to_cpumask_ptr_next(v, node) \ 123#define node_to_cpumask_ptr_next(v, node) \
124 v = _node_to_cpumask_ptr(node) 124 v = _node_to_cpumask_ptr(node)
@@ -186,7 +186,7 @@ extern int __node_distance(int, int);
186#define cpu_to_node(cpu) 0 186#define cpu_to_node(cpu) 0
187#define early_cpu_to_node(cpu) 0 187#define early_cpu_to_node(cpu) 0
188 188
189static inline cpumask_t *_node_to_cpumask_ptr(int node) 189static inline const cpumask_t *_node_to_cpumask_ptr(int node)
190{ 190{
191 return &cpu_online_map; 191 return &cpu_online_map;
192} 192}
@@ -201,7 +201,7 @@ static inline int node_to_first_cpu(int node)
201 201
202/* Replace default node_to_cpumask_ptr with optimized version */ 202/* Replace default node_to_cpumask_ptr with optimized version */
203#define node_to_cpumask_ptr(v, node) \ 203#define node_to_cpumask_ptr(v, node) \
204 cpumask_t *v = _node_to_cpumask_ptr(node) 204 const cpumask_t *v = _node_to_cpumask_ptr(node)
205 205
206#define node_to_cpumask_ptr_next(v, node) \ 206#define node_to_cpumask_ptr_next(v, node) \
207 v = _node_to_cpumask_ptr(node) 207 v = _node_to_cpumask_ptr(node)