Skip to content

Commit

Permalink
ARM: boolean bit testing
Browse files Browse the repository at this point in the history
Bit testing (test, testset, testclear, testchange) for bit numbers
known at compile time returns a word with the tested-for bit set.

Change it to return a true boolean value so to make it consistent with
the out-of-line path and all the other bitops implementations.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Johannes Weiner authored and Russell King committed Oct 11, 2009
1 parent 03a6e5b commit e9ac829
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/arm/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ ____atomic_test_and_set_bit(unsigned int bit, volatile unsigned long *p)
*p = res | mask;
raw_local_irq_restore(flags);

return res & mask;
return (res & mask) != 0;
}

static inline int
Expand All @@ -101,7 +101,7 @@ ____atomic_test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
*p = res & ~mask;
raw_local_irq_restore(flags);

return res & mask;
return (res & mask) != 0;
}

static inline int
Expand All @@ -118,7 +118,7 @@ ____atomic_test_and_change_bit(unsigned int bit, volatile unsigned long *p)
*p = res ^ mask;
raw_local_irq_restore(flags);

return res & mask;
return (res & mask) != 0;
}

#include <asm-generic/bitops/non-atomic.h>
Expand Down

0 comments on commit e9ac829

Please sign in to comment.