]> err.no Git - linux-2.6/commitdiff
[ARM] 5067/1: _raw_write_can_lock macro bugfix
authorsurinder <srplsnh@gmail.com>
Wed, 28 May 2008 08:51:16 +0000 (09:51 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 2 Jun 2008 12:44:17 +0000 (13:44 +0100)
The current __raw_write_can_lock macro tests whether the lock can be
locked by checking if it is equal to 0x80000000, whereas the lock
should be lockable if its value is 0 i.e. unlocked state is
represented by 0. Hence the macro should test the value of lock
against 0 and not 0x80000000.

Signed-off-by: Surinder Pal Singh <srplsnh@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
include/asm-arm/spinlock.h

index 800ba5254dafef9bff57c98a19dcb599b0982cbc..2b41ebbfa7ffe261841d8bd17835f24abe8750ea 100644 (file)
@@ -142,7 +142,7 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
 }
 
 /* write_can_lock - would write_trylock() succeed? */
-#define __raw_write_can_lock(x)                ((x)->lock == 0x80000000)
+#define __raw_write_can_lock(x)                ((x)->lock == 0)
 
 /*
  * Read locks are a bit more hairy: