diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2015-03-30 22:55:05 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2015-03-30 23:25:31 -0400 |
commit | 3bbf7f4624856751aa4cf279a472bd14a8eb16fd (patch) | |
tree | c3b003181e02c575d2f05b234f28dbc5966a585c | |
parent | cdfdef75e795fb5ab76c66f3329e509f3ab8b9b5 (diff) |
linux/cpumask.h: add typechecking to cpumask_test_cpu
The Subtlety (1) referred to vanished with 6ba2ef7baac2 ("cpumask:
Move deprecated functions to end of header."). That used to mention
some suboptimal code generation by a, by now, rather ancient gcc. With
gcc 4.7, I don't see any change in the generated code by making it a
static inline, so let's add type checking and get rid of the ghost
reference.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r-- | include/linux/cpumask.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 4ad2d3c8e21f..89558d0b56ac 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -290,11 +290,11 @@ static inline void cpumask_clear_cpu(int cpu, struct cpumask *dstp) | |||
290 | * @cpumask: the cpumask pointer | 290 | * @cpumask: the cpumask pointer |
291 | * | 291 | * |
292 | * Returns 1 if @cpu is set in @cpumask, else returns 0 | 292 | * Returns 1 if @cpu is set in @cpumask, else returns 0 |
293 | * | ||
294 | * No static inline type checking - see Subtlety (1) above. | ||
295 | */ | 293 | */ |
296 | #define cpumask_test_cpu(cpu, cpumask) \ | 294 | static inline int cpumask_test_cpu(int cpu, const struct cpumask *cpumask) |
297 | test_bit(cpumask_check(cpu), cpumask_bits((cpumask))) | 295 | { |
296 | return test_bit(cpumask_check(cpu), cpumask_bits((cpumask))); | ||
297 | } | ||
298 | 298 | ||
299 | /** | 299 | /** |
300 | * cpumask_test_and_set_cpu - atomically test and set a cpu in a cpumask | 300 | * cpumask_test_and_set_cpu - atomically test and set a cpu in a cpumask |