mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
x86: change _node_to_cpumask_ptr to return const ptr
* Strengthen the return type for the _node_to_cpumask_ptr to be
a const pointer. This adds compiler checking to insure that
node_to_cpumask_map[] is not changed inadvertently.
Signed-off-by: Mike Travis <[email protected]>
Cc: "[email protected]" <[email protected]>
Cc: Yinghai Lu <[email protected]>
Acked-by: Vegard Nossum <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
ce8b06b985
commit
11369f356b
3 changed files with 11 additions and 10 deletions
|
|
@ -82,7 +82,7 @@ DECLARE_EARLY_PER_CPU(int, x86_cpu_to_node_map);
|
|||
#ifdef CONFIG_DEBUG_PER_CPU_MAPS
|
||||
extern int cpu_to_node(int cpu);
|
||||
extern int early_cpu_to_node(int cpu);
|
||||
extern cpumask_t *_node_to_cpumask_ptr(int node);
|
||||
extern const cpumask_t *_node_to_cpumask_ptr(int node);
|
||||
extern cpumask_t node_to_cpumask(int node);
|
||||
|
||||
#else /* !CONFIG_DEBUG_PER_CPU_MAPS */
|
||||
|
|
@ -103,7 +103,7 @@ static inline int early_cpu_to_node(int cpu)
|
|||
}
|
||||
|
||||
/* Returns a pointer to the cpumask of CPUs on Node 'node'. */
|
||||
static inline cpumask_t *_node_to_cpumask_ptr(int node)
|
||||
static inline const cpumask_t *_node_to_cpumask_ptr(int node)
|
||||
{
|
||||
return &node_to_cpumask_map[node];
|
||||
}
|
||||
|
|
@ -118,7 +118,7 @@ static inline cpumask_t node_to_cpumask(int node)
|
|||
|
||||
/* Replace default node_to_cpumask_ptr with optimized version */
|
||||
#define node_to_cpumask_ptr(v, node) \
|
||||
cpumask_t *v = _node_to_cpumask_ptr(node)
|
||||
const cpumask_t *v = _node_to_cpumask_ptr(node)
|
||||
|
||||
#define node_to_cpumask_ptr_next(v, node) \
|
||||
v = _node_to_cpumask_ptr(node)
|
||||
|
|
@ -186,7 +186,7 @@ extern int __node_distance(int, int);
|
|||
#define cpu_to_node(cpu) 0
|
||||
#define early_cpu_to_node(cpu) 0
|
||||
|
||||
static inline cpumask_t *_node_to_cpumask_ptr(int node)
|
||||
static inline const cpumask_t *_node_to_cpumask_ptr(int node)
|
||||
{
|
||||
return &cpu_online_map;
|
||||
}
|
||||
|
|
@ -201,7 +201,7 @@ static inline int node_to_first_cpu(int node)
|
|||
|
||||
/* Replace default node_to_cpumask_ptr with optimized version */
|
||||
#define node_to_cpumask_ptr(v, node) \
|
||||
cpumask_t *v = _node_to_cpumask_ptr(node)
|
||||
const cpumask_t *v = _node_to_cpumask_ptr(node)
|
||||
|
||||
#define node_to_cpumask_ptr_next(v, node) \
|
||||
v = _node_to_cpumask_ptr(node)
|
||||
|
|
|
|||
Loading…
Reference in a new issue