Skip to content

Commit

Permalink
cpumask: change return types to bool where appropriate
Browse files Browse the repository at this point in the history
Some cpumask functions have integer return types where return values
are naturally booleans.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
  • Loading branch information
Yury Norov committed Jul 15, 2022
1 parent 4dea97f commit cb32c28
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions include/linux/cpumask.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,9 @@ static __always_inline void __cpumask_clear_cpu(int cpu, struct cpumask *dstp)
* @cpu: cpu number (< nr_cpu_ids)
* @cpumask: the cpumask pointer
*
* Returns 1 if @cpu is set in @cpumask, else returns 0
* Returns true if @cpu is set in @cpumask, else returns false
*/
static __always_inline int cpumask_test_cpu(int cpu, const struct cpumask *cpumask)
static __always_inline bool cpumask_test_cpu(int cpu, const struct cpumask *cpumask)
{
return test_bit(cpumask_check(cpu), cpumask_bits((cpumask)));
}
Expand All @@ -384,11 +384,11 @@ static __always_inline int cpumask_test_cpu(int cpu, const struct cpumask *cpuma
* @cpu: cpu number (< nr_cpu_ids)
* @cpumask: the cpumask pointer
*
* Returns 1 if @cpu is set in old bitmap of @cpumask, else returns 0
* Returns true if @cpu is set in old bitmap of @cpumask, else returns false
*
* test_and_set_bit wrapper for cpumasks.
*/
static __always_inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask)
static __always_inline bool cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask)
{
return test_and_set_bit(cpumask_check(cpu), cpumask_bits(cpumask));
}
Expand All @@ -398,11 +398,11 @@ static __always_inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpu
* @cpu: cpu number (< nr_cpu_ids)
* @cpumask: the cpumask pointer
*
* Returns 1 if @cpu is set in old bitmap of @cpumask, else returns 0
* Returns true if @cpu is set in old bitmap of @cpumask, else returns false
*
* test_and_clear_bit wrapper for cpumasks.
*/
static __always_inline int cpumask_test_and_clear_cpu(int cpu, struct cpumask *cpumask)
static __always_inline bool cpumask_test_and_clear_cpu(int cpu, struct cpumask *cpumask)
{
return test_and_clear_bit(cpumask_check(cpu), cpumask_bits(cpumask));
}
Expand Down Expand Up @@ -431,9 +431,9 @@ static inline void cpumask_clear(struct cpumask *dstp)
* @src1p: the first input
* @src2p: the second input
*
* If *@dstp is empty, returns 0, else returns 1
* If *@dstp is empty, returns false, else returns true
*/
static inline int cpumask_and(struct cpumask *dstp,
static inline bool cpumask_and(struct cpumask *dstp,
const struct cpumask *src1p,
const struct cpumask *src2p)
{
Expand Down Expand Up @@ -474,9 +474,9 @@ static inline void cpumask_xor(struct cpumask *dstp,
* @src1p: the first input
* @src2p: the second input
*
* If *@dstp is empty, returns 0, else returns 1
* If *@dstp is empty, returns false, else returns true
*/
static inline int cpumask_andnot(struct cpumask *dstp,
static inline bool cpumask_andnot(struct cpumask *dstp,
const struct cpumask *src1p,
const struct cpumask *src2p)
{
Expand Down Expand Up @@ -539,9 +539,9 @@ static inline bool cpumask_intersects(const struct cpumask *src1p,
* @src1p: the first input
* @src2p: the second input
*
* Returns 1 if *@src1p is a subset of *@src2p, else returns 0
* Returns true if *@src1p is a subset of *@src2p, else returns false
*/
static inline int cpumask_subset(const struct cpumask *src1p,
static inline bool cpumask_subset(const struct cpumask *src1p,
const struct cpumask *src2p)
{
return bitmap_subset(cpumask_bits(src1p), cpumask_bits(src2p),
Expand Down

0 comments on commit cb32c28

Please sign in to comment.