diff options
author | Jesper Nilsson <jesper.nilsson@axis.com> | 2008-01-21 11:01:31 -0500 |
---|---|---|
committer | Jesper Nilsson <jesper.nilsson@axis.com> | 2008-02-08 05:06:33 -0500 |
commit | 3c1d9303a9676fd4f9062f2347f1a6241eb6314b (patch) | |
tree | ac0352ae3b19367b4efcd4c139ad0bd04bd2e2e3 | |
parent | b43890af886b14d3052d8b7f9e0b2f8d261dcd7d (diff) |
CRIS: Fix bugs in return value of atomic_inc_return and atomic_dec_return.
Increment and decrement before assigning to return value.
-rw-r--r-- | include/asm-cris/atomic.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/asm-cris/atomic.h b/include/asm-cris/atomic.h index 2949a945876a..5fc87768774a 100644 --- a/include/asm-cris/atomic.h +++ b/include/asm-cris/atomic.h | |||
@@ -91,7 +91,7 @@ static inline int atomic_inc_return(volatile atomic_t *v) | |||
91 | unsigned long flags; | 91 | unsigned long flags; |
92 | int retval; | 92 | int retval; |
93 | cris_atomic_save(v, flags); | 93 | cris_atomic_save(v, flags); |
94 | retval = (v->counter)++; | 94 | retval = ++(v->counter); |
95 | cris_atomic_restore(v, flags); | 95 | cris_atomic_restore(v, flags); |
96 | return retval; | 96 | return retval; |
97 | } | 97 | } |
@@ -101,7 +101,7 @@ static inline int atomic_dec_return(volatile atomic_t *v) | |||
101 | unsigned long flags; | 101 | unsigned long flags; |
102 | int retval; | 102 | int retval; |
103 | cris_atomic_save(v, flags); | 103 | cris_atomic_save(v, flags); |
104 | retval = (v->counter)--; | 104 | retval = --(v->counter); |
105 | cris_atomic_restore(v, flags); | 105 | cris_atomic_restore(v, flags); |
106 | return retval; | 106 | return retval; |
107 | } | 107 | } |