Commit 4cec87361462d570d6a67888feda41e77e0a9562

Authored by Linus Torvalds
1 parent 7e4e574c39

Fix mutex_trylock() copy-and-paste bug (x86, x86-64, generic mutex-dec.h)

Noticed by Arjan originally on x86-64, then Ingo on x86, and finally me
grepping for it in the generic version.

Bad parenthesis nesting.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 3 changed files with 3 additions and 3 deletions Side-by-side Diff

include/asm-generic/mutex-dec.h
... ... @@ -97,7 +97,7 @@
97 97 * the mutex state would be.
98 98 */
99 99 #ifdef __HAVE_ARCH_CMPXCHG
100   - if (likely(atomic_cmpxchg(count, 1, 0)) == 1) {
  100 + if (likely(atomic_cmpxchg(count, 1, 0) == 1)) {
101 101 smp_mb();
102 102 return 1;
103 103 }
include/asm-i386/mutex.h
... ... @@ -125,7 +125,7 @@
125 125 * the mutex state would be.
126 126 */
127 127 #ifdef __HAVE_ARCH_CMPXCHG
128   - if (likely(atomic_cmpxchg(count, 1, 0)) == 1)
  128 + if (likely(atomic_cmpxchg(count, 1, 0) == 1))
129 129 return 1;
130 130 return 0;
131 131 #else
include/asm-x86_64/mutex.h
... ... @@ -104,7 +104,7 @@
104 104 static inline int
105 105 __mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *))
106 106 {
107   - if (likely(atomic_cmpxchg(count, 1, 0)) == 1)
  107 + if (likely(atomic_cmpxchg(count, 1, 0) == 1))
108 108 return 1;
109 109 else
110 110 return 0;