Skip to contentSkip to conversation

ia64: boolean __test_and_clear_bit

PATCH New Johannes Weiner 1 participant 1 message Jul 21, 2009 Bitops API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ia64: boolean __test_and_clear_bit

__test_and_clear_bit() returns a bitfield with the tested-for bit set. Make it consistent with the other bitops - of ia64 but also every other architecture - and return a boolean value.

---
 arch/ia64/include/asm/bitops.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/ia64/include/asm/bitops.h +1 -1
index e2ca800..57a2787 100644
@@ -286,7 +286,7 @@ __test_and_clear_bit(int nr, volatile void * addr)
 {
 	__u32 *p = (__u32 *) addr + (nr >> 5);
 	__u32 m = 1 << (nr & 31);
-	int oldbitset = *p & m;
+	int oldbitset = (*p & m) != 0;
 
 	*p &= ~m;
 	return oldbitset;
Signature · 1 line
1.6.3