Skip to content

Commit 1e5c594

Browse files
srplsnhRussell King
authored andcommitted
[ARM] 5067/1: _raw_write_can_lock macro bugfix
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 <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent ea6a740 commit 1e5c594

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/asm-arm/spinlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
142142
}
143143

144144
/* write_can_lock - would write_trylock() succeed? */
145-
#define __raw_write_can_lock(x) ((x)->lock == 0x80000000)
145+
#define __raw_write_can_lock(x) ((x)->lock == 0)
146146

147147
/*
148148
* Read locks are a bit more hairy:

0 commit comments

Comments
 (0)