patch-1.3.45 linux/include/asm-alpha/bitops.h

Next file: linux/include/asm-i386/bitops.h
Previous file: linux/fs/xiafs/inode.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.44/linux/include/asm-alpha/bitops.h linux/include/asm-alpha/bitops.h
@@ -17,6 +17,7 @@
 {
 	unsigned long oldbit;
 	unsigned long temp;
+	unsigned int * m = ((unsigned int *) addr) + (nr >> 5);
 
 	__asm__ __volatile__(
 		"\n1:\t"
@@ -28,10 +29,10 @@
 		"beq %0,1b\n"
 		"2:"
 		:"=&r" (temp),
-		 "=m" (((int *) addr)[nr >> 5]),
+		 "=m" (*m),
 		 "=&r" (oldbit)
 		:"r" (1UL << (nr & 31)),
-		 "m" (((int *) addr)[nr >> 5]));
+		 "m" (*m));
 	return oldbit != 0;
 }
 
@@ -39,6 +40,7 @@
 {
 	unsigned long oldbit;
 	unsigned long temp;
+	unsigned int * m = ((unsigned int *) addr) + (nr >> 5);
 
 	__asm__ __volatile__(
 		"\n1:\t"
@@ -50,10 +52,10 @@
 		"beq %0,1b\n"
 		"2:"
 		:"=&r" (temp),
-		 "=m" (((int *) addr)[nr >> 5]),
+		 "=m" (*m),
 		 "=&r" (oldbit)
 		:"r" (1UL << (nr & 31)),
-		 "m" (((int *) addr)[nr >> 5]));
+		 "m" (*m));
 	return oldbit != 0;
 }
 
@@ -61,6 +63,7 @@
 {
 	unsigned long oldbit;
 	unsigned long temp;
+	unsigned int * m = ((unsigned int *) addr) + (nr >> 5);
 
 	__asm__ __volatile__(
 		"\n1:\t"
@@ -70,10 +73,10 @@
 		"stl_c %0,%1\n\t"
 		"beq %0,1b\n"
 		:"=&r" (temp),
-		 "=m" (((int *) addr)[nr >> 5]),
+		 "=m" (*m),
 		 "=&r" (oldbit)
 		:"r" (1UL << (nr & 31)),
-		 "m" (((int *) addr)[nr >> 5]));
+		 "m" (*m));
 	return oldbit != 0;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this