From: "Jan Beulich" Subject: [PATCH] linux/x86: simplify synch_test_bit() Date: Fri, 14 Mar 2008 07:54:00 +0000 Message-ID: <47DA3D28.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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. Signed-off-by: Jan Beulich Index: head-2008-03-11/include/asm-i386/mach-xen/asm/synch_bitops.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head-2008-03-11.orig/include/asm-i386/mach-xen/asm/synch_bitops.h = 2008-03-12 17:07:19.000000000 +0100 +++ head-2008-03-11/include/asm-i386/mach-xen/asm/synch_bitops.h = 2008-03-12 17:10:21.000000000 +0100 @@ -119,26 +119,7 @@ static inline unsigned long __synch_cmpx return old; } =20 -static __always_inline int synch_const_test_bit(int nr, - const volatile void * = addr) -{ - return ((1UL << (nr & 31)) &=20 - (((const volatile unsigned int *) addr)[nr >> 5])) !=3D 0; -} - -static __inline__ int synch_var_test_bit(int nr, volatile void * addr) -{ - int oldbit; - __asm__ __volatile__ ( - "btl %2,%1\n\tsbbl %0,%0" - : "=3Dr" (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 =20 #define synch_cmpxchg_subword synch_cmpxchg =20