]> err.no Git - linux-2.6/commitdiff
Fix mutex_trylock() copy-and-paste bug (x86, x86-64, generic mutex-dec.h)
authorLinus Torvalds <torvalds@g5.osdl.org>
Wed, 11 Jan 2006 23:50:47 +0000 (15:50 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 11 Jan 2006 23:50:47 +0000 (15:50 -0800)
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>
include/asm-generic/mutex-dec.h
include/asm-i386/mutex.h
include/asm-x86_64/mutex.h

index 74b18cda169f92777ffd19f743ab65f6d841bd52..40c6d1f8659846cb05cd57c524b296dfa7617a17 100644 (file)
@@ -97,7 +97,7 @@ __mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *))
         * the mutex state would be.
         */
 #ifdef __HAVE_ARCH_CMPXCHG
-       if (likely(atomic_cmpxchg(count, 1, 0)) == 1) {
+       if (likely(atomic_cmpxchg(count, 1, 0) == 1)) {
                smp_mb();
                return 1;
        }
index c657d4b09f0a23d96f0cdf24bb606201f49751dd..9b2199e829f36c7b1606b74f7e4b3f5bc6f61fd3 100644 (file)
@@ -125,7 +125,7 @@ __mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *))
         * the mutex state would be.
         */
 #ifdef __HAVE_ARCH_CMPXCHG
-       if (likely(atomic_cmpxchg(count, 1, 0)) == 1)
+       if (likely(atomic_cmpxchg(count, 1, 0) == 1))
                return 1;
        return 0;
 #else
index 818abfd262d1708f3318c385594a2e63c23c95fd..11fbee2bd6c068486f850ad39fdc5590ec3c137a 100644 (file)
@@ -104,7 +104,7 @@ do {                                                                        \
 static inline int
 __mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *))
 {
-       if (likely(atomic_cmpxchg(count, 1, 0)) == 1)
+       if (likely(atomic_cmpxchg(count, 1, 0) == 1))
                return 1;
        else
                return 0;