Commit b0903ee8 authored by Roel Kluin's avatar Roel Kluin Committed by Jesper Nilsson

CRIS: assignment/is equal confusion

Somehow, the assignments of rw->lock got written as comparisons.
The effect probably was that the read-write spinlocks never locked.
However, since the locks are only used in CONFIG_SMP and SMP CRIS is
experimental, it has never been identified as a problem.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Acked-by: default avatarJesper Nilsson <jesper.nilsson@axis.com>
parent ccc0d38e
...@@ -78,7 +78,7 @@ static inline void __raw_write_lock(raw_rwlock_t *rw) ...@@ -78,7 +78,7 @@ static inline void __raw_write_lock(raw_rwlock_t *rw)
{ {
__raw_spin_lock(&rw->slock); __raw_spin_lock(&rw->slock);
while (rw->lock != RW_LOCK_BIAS); while (rw->lock != RW_LOCK_BIAS);
rw->lock == 0; rw->lock = 0;
__raw_spin_unlock(&rw->slock); __raw_spin_unlock(&rw->slock);
} }
...@@ -93,7 +93,7 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw) ...@@ -93,7 +93,7 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
{ {
__raw_spin_lock(&rw->slock); __raw_spin_lock(&rw->slock);
while (rw->lock != RW_LOCK_BIAS); while (rw->lock != RW_LOCK_BIAS);
rw->lock == RW_LOCK_BIAS; rw->lock = RW_LOCK_BIAS;
__raw_spin_unlock(&rw->slock); __raw_spin_unlock(&rw->slock);
} }
...@@ -114,7 +114,7 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw) ...@@ -114,7 +114,7 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
int ret = 0; int ret = 0;
__raw_spin_lock(&rw->slock); __raw_spin_lock(&rw->slock);
if (rw->lock == RW_LOCK_BIAS) { if (rw->lock == RW_LOCK_BIAS) {
rw->lock == 0; rw->lock = 0;
ret = 1; ret = 1;
} }
__raw_spin_unlock(&rw->slock); __raw_spin_unlock(&rw->slock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment