diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-29 17:35:16 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-29 17:35:16 -0500 |
commit | 3fa41520696fec2815e2d88fbcccdda77ba4d693 (patch) | |
tree | 418c698535189083b9cbed28bc30e895bda147e3 /include | |
parent | ae7a47e72e1a0b5e2b46d1596bc2c22942a73023 (diff) |
cpumask: make set_cpu_*/init_cpu_* out-of-line
They're only for use in boot/cpu hotplug code anyway, and this avoids
the use of deprecated cpu_*_map.
Stephen Rothwell points out that gcc 4.2.4 (on powerpc at least)
didn't like the cast away of const anyway:
include/linux/cpumask.h: In function 'set_cpu_possible':
include/linux/cpumask.h:1052: warning: passing argument 2 of 'cpumask_set_cpu' discards qualifiers from pointer target type
So this kills two birds with one stone.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/cpumask.h | 53 |
1 files changed, 7 insertions, 46 deletions
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index e62a67156c53..7c178a6baae3 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -1057,50 +1057,11 @@ extern const DECLARE_BITMAP(cpu_all_bits, NR_CPUS); | |||
1057 | #define for_each_present_cpu(cpu) for_each_cpu((cpu), cpu_present_mask) | 1057 | #define for_each_present_cpu(cpu) for_each_cpu((cpu), cpu_present_mask) |
1058 | 1058 | ||
1059 | /* Wrappers for arch boot code to manipulate normally-constant masks */ | 1059 | /* Wrappers for arch boot code to manipulate normally-constant masks */ |
1060 | static inline void set_cpu_possible(unsigned int cpu, bool possible) | 1060 | void set_cpu_possible(unsigned int cpu, bool possible); |
1061 | { | 1061 | void set_cpu_present(unsigned int cpu, bool present); |
1062 | if (possible) | 1062 | void set_cpu_online(unsigned int cpu, bool online); |
1063 | cpumask_set_cpu(cpu, &cpu_possible_map); | 1063 | void set_cpu_active(unsigned int cpu, bool active); |
1064 | else | 1064 | void init_cpu_present(const struct cpumask *src); |
1065 | cpumask_clear_cpu(cpu, &cpu_possible_map); | 1065 | void init_cpu_possible(const struct cpumask *src); |
1066 | } | 1066 | void init_cpu_online(const struct cpumask *src); |
1067 | |||
1068 | static inline void set_cpu_present(unsigned int cpu, bool present) | ||
1069 | { | ||
1070 | if (present) | ||
1071 | cpumask_set_cpu(cpu, &cpu_present_map); | ||
1072 | else | ||
1073 | cpumask_clear_cpu(cpu, &cpu_present_map); | ||
1074 | } | ||
1075 | |||
1076 | static inline void set_cpu_online(unsigned int cpu, bool online) | ||
1077 | { | ||
1078 | if (online) | ||
1079 | cpumask_set_cpu(cpu, &cpu_online_map); | ||
1080 | else | ||
1081 | cpumask_clear_cpu(cpu, &cpu_online_map); | ||
1082 | } | ||
1083 | |||
1084 | static inline void set_cpu_active(unsigned int cpu, bool active) | ||
1085 | { | ||
1086 | if (active) | ||
1087 | cpumask_set_cpu(cpu, &cpu_active_map); | ||
1088 | else | ||
1089 | cpumask_clear_cpu(cpu, &cpu_active_map); | ||
1090 | } | ||
1091 | |||
1092 | static inline void init_cpu_present(const struct cpumask *src) | ||
1093 | { | ||
1094 | cpumask_copy(&cpu_present_map, src); | ||
1095 | } | ||
1096 | |||
1097 | static inline void init_cpu_possible(const struct cpumask *src) | ||
1098 | { | ||
1099 | cpumask_copy(&cpu_possible_map, src); | ||
1100 | } | ||
1101 | |||
1102 | static inline void init_cpu_online(const struct cpumask *src) | ||
1103 | { | ||
1104 | cpumask_copy(&cpu_online_map, src); | ||
1105 | } | ||
1106 | #endif /* __LINUX_CPUMASK_H */ | 1067 | #endif /* __LINUX_CPUMASK_H */ |