[PATCH][PPC64] Fix inline version of _raw_spin_trylock

From: Paul Mackerras
Date: Thu May 20 2004 - 01:55:21 EST


When I added the out-of-line spinlocks on PPC64, I inadvertently
introduced a bug in the inline version of _raw_spin_trylock, where it
returns the opposite of what it should return. The patch below fixes
it.

Please apply.

Thanks,
Paul.

--- linux-2.5/include/asm-ppc64/spinlock.h 2004-05-15 13:32:16.000000000 +1000
+++ ppc64-linux-2.5/include/asm-ppc64/spinlock.h 2004-05-20 16:42:45.662218328 +1000
@@ -65,7 +65,7 @@
: "r"(&lock->lock)
: "cr0", "memory");

- return tmp != 0;
+ return tmp == 0;
}

static __inline__ void _raw_spin_lock(spinlock_t *lock)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/