Skip to contentSkip to conversation

linux/x86: simplify synch_test_bit()

PATCH New Jan Beulich 1 participant 1 message Mar 14, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux/x86: simplify synch_test_bit()

There really is no need for a redundant implementation here, just keep the alternative name for allowing consumers to use consistent naming.

As usual, written and tested on 2.6.25-rc5 and made apply to the 2.6.18 tree without further testing.

include/asm-i386/mach-xen/asm/synch_bitops.h +1 -20
Index: head-2008-03-11/include/asm-i386/mach-xen/asm/synch_bitops.h
===================================================================
@@ -119,26 +119,7 @@ static inline unsigned long __synch_cmpx
 	return old;
 }
 
-static __always_inline int synch_const_test_bit(int nr,
-						const volatile void * addr)
-{
-    return ((1UL << (nr & 31)) & 
-            (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
-}
-
-static __inline__ int synch_var_test_bit(int nr, volatile void * addr)
-{
-    int oldbit;
-    __asm__ __volatile__ (
-        "btl %2,%1\n\tsbbl %0,%0"
-        : "=r" (oldbit) : "m" (ADDR), "Ir" (nr) );
-    return oldbit;
-}
-
-#define synch_test_bit(nr,addr) \
-(__builtin_constant_p(nr) ? \
- synch_const_test_bit((nr),(addr)) : \
- synch_var_test_bit((nr),(addr)))
+#define synch_test_bit test_bit
 
 #define synch_cmpxchg_subword synch_cmpxchg