Commit 8bf69f6f authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Linus Torvalds

[PATCH] s390 update (10/27): bitops bug.

Fix broken bitops for unaligned atomic operations on s390.
parent c6b71ca4
...@@ -59,8 +59,8 @@ static inline void set_bit_cs(int nr, volatile void *ptr) ...@@ -59,8 +59,8 @@ static inline void set_bit_cs(int nr, volatile void *ptr)
addr = (unsigned long) ptr; addr = (unsigned long) ptr;
#if ALIGN_CS == 1 #if ALIGN_CS == 1
addr ^= addr & 3; /* align address to 4 */
nr += (addr & 3) << 3; /* add alignment to bit number */ nr += (addr & 3) << 3; /* add alignment to bit number */
addr ^= addr & 3; /* align address to 4 */
#endif #endif
addr += (nr ^ (nr & 31)) >> 3; /* calculate address for CS */ addr += (nr ^ (nr & 31)) >> 3; /* calculate address for CS */
mask = 1UL << (nr & 31); /* make OR mask */ mask = 1UL << (nr & 31); /* make OR mask */
...@@ -84,8 +84,8 @@ static inline void clear_bit_cs(int nr, volatile void *ptr) ...@@ -84,8 +84,8 @@ static inline void clear_bit_cs(int nr, volatile void *ptr)
addr = (unsigned long) ptr; addr = (unsigned long) ptr;
#if ALIGN_CS == 1 #if ALIGN_CS == 1
addr ^= addr & 3; /* align address to 4 */
nr += (addr & 3) << 3; /* add alignment to bit number */ nr += (addr & 3) << 3; /* add alignment to bit number */
addr ^= addr & 3; /* align address to 4 */
#endif #endif
addr += (nr ^ (nr & 31)) >> 3; /* calculate address for CS */ addr += (nr ^ (nr & 31)) >> 3; /* calculate address for CS */
mask = ~(1UL << (nr & 31)); /* make AND mask */ mask = ~(1UL << (nr & 31)); /* make AND mask */
...@@ -109,8 +109,8 @@ static inline void change_bit_cs(int nr, volatile void *ptr) ...@@ -109,8 +109,8 @@ static inline void change_bit_cs(int nr, volatile void *ptr)
addr = (unsigned long) ptr; addr = (unsigned long) ptr;
#if ALIGN_CS == 1 #if ALIGN_CS == 1
addr ^= addr & 3; /* align address to 4 */
nr += (addr & 3) << 3; /* add alignment to bit number */ nr += (addr & 3) << 3; /* add alignment to bit number */
addr ^= addr & 3; /* align address to 4 */
#endif #endif
addr += (nr ^ (nr & 31)) >> 3; /* calculate address for CS */ addr += (nr ^ (nr & 31)) >> 3; /* calculate address for CS */
mask = 1UL << (nr & 31); /* make XOR mask */ mask = 1UL << (nr & 31); /* make XOR mask */
...@@ -160,8 +160,8 @@ static inline int test_and_clear_bit_cs(int nr, volatile void *ptr) ...@@ -160,8 +160,8 @@ static inline int test_and_clear_bit_cs(int nr, volatile void *ptr)
addr = (unsigned long) ptr; addr = (unsigned long) ptr;
#if ALIGN_CS == 1 #if ALIGN_CS == 1
addr ^= addr & 3; /* align address to 4 */
nr += (addr & 3) << 3; /* add alignment to bit number */ nr += (addr & 3) << 3; /* add alignment to bit number */
addr ^= addr & 3; /* align address to 4 */
#endif #endif
addr += (nr ^ (nr & 31)) >> 3; /* calculate address for CS */ addr += (nr ^ (nr & 31)) >> 3; /* calculate address for CS */
mask = ~(1UL << (nr & 31)); /* make AND mask */ mask = ~(1UL << (nr & 31)); /* make AND mask */
...@@ -186,8 +186,8 @@ static inline int test_and_change_bit_cs(int nr, volatile void *ptr) ...@@ -186,8 +186,8 @@ static inline int test_and_change_bit_cs(int nr, volatile void *ptr)
addr = (unsigned long) ptr; addr = (unsigned long) ptr;
#if ALIGN_CS == 1 #if ALIGN_CS == 1
addr ^= addr & 3; /* align address to 4 */
nr += (addr & 3) << 3; /* add alignment to bit number */ nr += (addr & 3) << 3; /* add alignment to bit number */
addr ^= addr & 3; /* align address to 4 */
#endif #endif
addr += (nr ^ (nr & 31)) >> 3; /* calculate address for CS */ addr += (nr ^ (nr & 31)) >> 3; /* calculate address for CS */
mask = 1UL << (nr & 31); /* make XOR mask */ mask = 1UL << (nr & 31); /* make XOR mask */
......
...@@ -63,8 +63,8 @@ static inline void set_bit_cs(unsigned long nr, volatile void *ptr) ...@@ -63,8 +63,8 @@ static inline void set_bit_cs(unsigned long nr, volatile void *ptr)
addr = (unsigned long) ptr; addr = (unsigned long) ptr;
#if ALIGN_CS == 1 #if ALIGN_CS == 1
addr ^= addr & 7; /* align address to 8 */
nr += (addr & 7) << 3; /* add alignment to bit number */ nr += (addr & 7) << 3; /* add alignment to bit number */
addr ^= addr & 7; /* align address to 8 */
#endif #endif
addr += (nr ^ (nr & 63)) >> 3; /* calculate address for CS */ addr += (nr ^ (nr & 63)) >> 3; /* calculate address for CS */
mask = 1UL << (nr & 63); /* make OR mask */ mask = 1UL << (nr & 63); /* make OR mask */
...@@ -88,8 +88,8 @@ static inline void clear_bit_cs(unsigned long nr, volatile void *ptr) ...@@ -88,8 +88,8 @@ static inline void clear_bit_cs(unsigned long nr, volatile void *ptr)
addr = (unsigned long) ptr; addr = (unsigned long) ptr;
#if ALIGN_CS == 1 #if ALIGN_CS == 1
addr ^= addr & 7; /* align address to 8 */
nr += (addr & 7) << 3; /* add alignment to bit number */ nr += (addr & 7) << 3; /* add alignment to bit number */
addr ^= addr & 7; /* align address to 8 */
#endif #endif
addr += (nr ^ (nr & 63)) >> 3; /* calculate address for CS */ addr += (nr ^ (nr & 63)) >> 3; /* calculate address for CS */
mask = ~(1UL << (nr & 63)); /* make AND mask */ mask = ~(1UL << (nr & 63)); /* make AND mask */
...@@ -113,8 +113,8 @@ static inline void change_bit_cs(unsigned long nr, volatile void *ptr) ...@@ -113,8 +113,8 @@ static inline void change_bit_cs(unsigned long nr, volatile void *ptr)
addr = (unsigned long) ptr; addr = (unsigned long) ptr;
#if ALIGN_CS == 1 #if ALIGN_CS == 1
addr ^= addr & 7; /* align address to 8 */
nr += (addr & 7) << 3; /* add alignment to bit number */ nr += (addr & 7) << 3; /* add alignment to bit number */
addr ^= addr & 7; /* align address to 8 */
#endif #endif
addr += (nr ^ (nr & 63)) >> 3; /* calculate address for CS */ addr += (nr ^ (nr & 63)) >> 3; /* calculate address for CS */
mask = 1UL << (nr & 63); /* make XOR mask */ mask = 1UL << (nr & 63); /* make XOR mask */
...@@ -139,8 +139,8 @@ test_and_set_bit_cs(unsigned long nr, volatile void *ptr) ...@@ -139,8 +139,8 @@ test_and_set_bit_cs(unsigned long nr, volatile void *ptr)
addr = (unsigned long) ptr; addr = (unsigned long) ptr;
#if ALIGN_CS == 1 #if ALIGN_CS == 1
addr ^= addr & 7; /* align address to 8 */
nr += (addr & 7) << 3; /* add alignment to bit number */ nr += (addr & 7) << 3; /* add alignment to bit number */
addr ^= addr & 7; /* align address to 8 */
#endif #endif
addr += (nr ^ (nr & 63)) >> 3; /* calculate address for CS */ addr += (nr ^ (nr & 63)) >> 3; /* calculate address for CS */
mask = 1UL << (nr & 63); /* make OR/test mask */ mask = 1UL << (nr & 63); /* make OR/test mask */
...@@ -166,8 +166,8 @@ test_and_clear_bit_cs(unsigned long nr, volatile void *ptr) ...@@ -166,8 +166,8 @@ test_and_clear_bit_cs(unsigned long nr, volatile void *ptr)
addr = (unsigned long) ptr; addr = (unsigned long) ptr;
#if ALIGN_CS == 1 #if ALIGN_CS == 1
addr ^= addr & 7; /* align address to 8 */
nr += (addr & 7) << 3; /* add alignment to bit number */ nr += (addr & 7) << 3; /* add alignment to bit number */
addr ^= addr & 7; /* align address to 8 */
#endif #endif
addr += (nr ^ (nr & 63)) >> 3; /* calculate address for CS */ addr += (nr ^ (nr & 63)) >> 3; /* calculate address for CS */
mask = ~(1UL << (nr & 63)); /* make AND mask */ mask = ~(1UL << (nr & 63)); /* make AND mask */
...@@ -193,8 +193,8 @@ test_and_change_bit_cs(unsigned long nr, volatile void *ptr) ...@@ -193,8 +193,8 @@ test_and_change_bit_cs(unsigned long nr, volatile void *ptr)
addr = (unsigned long) ptr; addr = (unsigned long) ptr;
#if ALIGN_CS == 1 #if ALIGN_CS == 1
addr ^= addr & 7; /* align address to 8 */
nr += (addr & 7) << 3; /* add alignment to bit number */ nr += (addr & 7) << 3; /* add alignment to bit number */
addr ^= addr & 7; /* align address to 8 */
#endif #endif
addr += (nr ^ (nr & 63)) >> 3; /* calculate address for CS */ addr += (nr ^ (nr & 63)) >> 3; /* calculate address for CS */
mask = 1UL << (nr & 63); /* make XOR mask */ mask = 1UL << (nr & 63); /* make XOR mask */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment