locking,arch: Use ACCESS_ONCE() instead of cast to volatile in atomic_read()
[linux-2.6-block.git] / arch / x86 / include / asm / atomic.h
index 6dd1c7dd0473aecbaa1af28377878a36ac3dfa73..5e5cd123fdfbc2b0fe90cabc5d27948d3ded267a 100644 (file)
@@ -24,7 +24,7 @@
  */
 static inline int atomic_read(const atomic_t *v)
 {
-       return (*(volatile int *)&(v)->counter);
+       return ACCESS_ONCE((v)->counter);
 }
 
 /**
@@ -219,21 +219,6 @@ static inline short int atomic_inc_short(short int *v)
        return *v;
 }
 
-#ifdef CONFIG_X86_64
-/**
- * atomic_or_long - OR of two long integers
- * @v1: pointer to type unsigned long
- * @v2: pointer to type unsigned long
- *
- * Atomically ORs @v1 and @v2
- * Returns the result of the OR
- */
-static inline void atomic_or_long(unsigned long *v1, unsigned long v2)
-{
-       asm(LOCK_PREFIX "orq %1, %0" : "+m" (*v1) : "r" (v2));
-}
-#endif
-
 /* These are x86-specific, used by some header files */
 #define atomic_clear_mask(mask, addr)                          \
        asm volatile(LOCK_PREFIX "andl %0,%1"                   \