aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2014-09-02 16:21:26 -0400
committerIngo Molnar <mingo@kernel.org>2014-09-10 05:45:06 -0400
commitda4c54457e6d8262423aded4bcbccc4103049506 (patch)
tree0dfed5231a18a1caa9b855ba526b24d046b2c295
parentcaa17d49f9a5cc09b3bbb101dc640f914f3b4ff7 (diff)
locking, mips: Fix atomics
The patch folding the atomic ops had two silly fails in the _return primitives. Fixes: ef31563e950c ("locking,arch,mips: Fold atomic_ops") Reported-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Bart Van Assche <bvanassche@acm.org> Cc: Hannes Reinecke <hare@suse.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Maciej W. Rozycki <macro@codesourcery.com> Cc: Markos Chandras <markos.chandras@imgtec.com> Cc: Paul Burton <paul.burton@imgtec.com> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Link: http://lkml.kernel.org/r/20140902202126.GA3190@worktop.ger.corp.intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/mips/include/asm/atomic.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h
index 476fe3b5dfc6..f3ee721fe61d 100644
--- a/arch/mips/include/asm/atomic.h
+++ b/arch/mips/include/asm/atomic.h
@@ -93,7 +93,7 @@ static __inline__ int atomic_##op##_return(int i, atomic_t * v) \
93 " " #asm_op " %0, %1, %3 \n" \ 93 " " #asm_op " %0, %1, %3 \n" \
94 " sc %0, %2 \n" \ 94 " sc %0, %2 \n" \
95 " beqzl %0, 1b \n" \ 95 " beqzl %0, 1b \n" \
96 " addu %0, %1, %3 \n" \ 96 " " #asm_op " %0, %1, %3 \n" \
97 " .set mips0 \n" \ 97 " .set mips0 \n" \
98 : "=&r" (result), "=&r" (temp), "+m" (v->counter) \ 98 : "=&r" (result), "=&r" (temp), "+m" (v->counter) \
99 : "Ir" (i)); \ 99 : "Ir" (i)); \
@@ -111,7 +111,7 @@ static __inline__ int atomic_##op##_return(int i, atomic_t * v) \
111 : "Ir" (i)); \ 111 : "Ir" (i)); \
112 } while (unlikely(!result)); \ 112 } while (unlikely(!result)); \
113 \ 113 \
114 result = temp + i; \ 114 result = temp; result c_op i; \
115 } else { \ 115 } else { \
116 unsigned long flags; \ 116 unsigned long flags; \
117 \ 117 \
@@ -387,7 +387,7 @@ static __inline__ long atomic64_##op##_return(long i, atomic64_t * v) \
387 : "memory"); \ 387 : "memory"); \
388 } while (unlikely(!result)); \ 388 } while (unlikely(!result)); \
389 \ 389 \
390 result = temp + i; \ 390 result = temp; result c_op i; \
391 } else { \ 391 } else { \
392 unsigned long flags; \ 392 unsigned long flags; \
393 \ 393 \