]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
parisc: fix macro expansion in atomic.h
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Sun, 22 Mar 2009 03:58:40 +0000 (03:58 +0000)
committerKyle McMartin <kyle@mcmartin.ca>
Tue, 31 Mar 2009 03:10:37 +0000 (03:10 +0000)
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
arch/parisc/include/asm/atomic.h

index edbfe25c5fc142475e26d7ffff051d5a61003731..ada3e5364d8254993f85d9586c51abb1278cb6bc 100644 (file)
@@ -25,7 +25,7 @@
  * Since "a" is usually an address, use one spinlock per cacheline.
  */
 #  define ATOMIC_HASH_SIZE 4
-#  define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) a)/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
+#  define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) (a))/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
 
 extern raw_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned;
 
@@ -222,13 +222,13 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
 
 #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
 
-#define atomic_add(i,v)        ((void)(__atomic_add_return( ((int)i),(v))))
-#define atomic_sub(i,v)        ((void)(__atomic_add_return(-((int)i),(v))))
+#define atomic_add(i,v)        ((void)(__atomic_add_return( ((int)(i)),(v))))
+#define atomic_sub(i,v)        ((void)(__atomic_add_return(-((int)(i)),(v))))
 #define atomic_inc(v)  ((void)(__atomic_add_return(   1,(v))))
 #define atomic_dec(v)  ((void)(__atomic_add_return(  -1,(v))))
 
-#define atomic_add_return(i,v) (__atomic_add_return( ((int)i),(v)))
-#define atomic_sub_return(i,v) (__atomic_add_return(-((int)i),(v)))
+#define atomic_add_return(i,v) (__atomic_add_return( ((int)(i)),(v)))
+#define atomic_sub_return(i,v) (__atomic_add_return(-((int)(i)),(v)))
 #define atomic_inc_return(v)   (__atomic_add_return(   1,(v)))
 #define atomic_dec_return(v)   (__atomic_add_return(  -1,(v)))
 
@@ -289,13 +289,13 @@ atomic64_read(const atomic64_t *v)
        return v->counter;
 }
 
-#define atomic64_add(i,v)      ((void)(__atomic64_add_return( ((s64)i),(v))))
-#define atomic64_sub(i,v)      ((void)(__atomic64_add_return(-((s64)i),(v))))
+#define atomic64_add(i,v)      ((void)(__atomic64_add_return( ((s64)(i)),(v))))
+#define atomic64_sub(i,v)      ((void)(__atomic64_add_return(-((s64)(i)),(v))))
 #define atomic64_inc(v)                ((void)(__atomic64_add_return(   1,(v))))
 #define atomic64_dec(v)                ((void)(__atomic64_add_return(  -1,(v))))
 
-#define atomic64_add_return(i,v)       (__atomic64_add_return( ((s64)i),(v)))
-#define atomic64_sub_return(i,v)       (__atomic64_add_return(-((s64)i),(v)))
+#define atomic64_add_return(i,v)       (__atomic64_add_return( ((s64)(i)),(v)))
+#define atomic64_sub_return(i,v)       (__atomic64_add_return(-((s64)(i)),(v)))
 #define atomic64_inc_return(v)         (__atomic64_add_return(   1,(v)))
 #define atomic64_dec_return(v)         (__atomic64_add_return(  -1,(v)))