Skip to contentSkip to conversation

s390: test_bit return value.

PATCH In review Martin Schwidefsky 1 participant 1 message Oct 28, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 8/14 s390: test_bit return value.

From: Christian Borntraeger <[email protected]>

[patch 8/14] s390: test_bit return value.

The test_bit function returns a non-boolean value, it returns 0,1,2,4,... instead of only 0 or 1. This causes wrongs results in the mincore system call. Check against 0 to get a proper boolean value.

---

 include/asm-s390/bitops.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
include/asm-s390/bitops.h +2 -2
diff -urpN linux-2.6/include/asm-s390/bitops.h linux-2.6-patched/include/asm-s390/bitops.h
@@ -518,8 +518,8 @@ static inline int __test_bit(unsigned lo
 
 static inline int 
 __constant_test_bit(unsigned long nr, const volatile unsigned long *addr) {
-    return (((volatile char *) addr)
-	    [(nr^(__BITOPS_WORDSIZE-8))>>3] & (1<<(nr&7)));
+    return ((((volatile char *) addr)
+	    [(nr^(__BITOPS_WORDSIZE-8))>>3] & (1<<(nr&7)))) != 0;
 }
 
 #define test_bit(nr,addr) \