Commit dcd880ed authored by Thomas Gleixner's avatar Thomas Gleixner

rt: Remove rwlocks BUG_ON and useless read_depth check

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 2763510c
...@@ -206,7 +206,7 @@ int __lockfunc rt_read_trylock(rwlock_t *rwlock) ...@@ -206,7 +206,7 @@ int __lockfunc rt_read_trylock(rwlock_t *rwlock)
/* /*
* recursive read locks succeed when current owns the lock * recursive read locks succeed when current owns the lock
*/ */
if (rt_mutex_real_owner(lock) != current || !rwlock->read_depth) if (rt_mutex_real_owner(lock) != current)
ret = rt_mutex_trylock(lock); ret = rt_mutex_trylock(lock);
if (ret) { if (ret) {
...@@ -234,7 +234,7 @@ void __lockfunc rt_read_lock(rwlock_t *rwlock) ...@@ -234,7 +234,7 @@ void __lockfunc rt_read_lock(rwlock_t *rwlock)
/* /*
* recursive read locks succeed when current owns the lock * recursive read locks succeed when current owns the lock
*/ */
if (rt_mutex_real_owner(lock) != current || !rwlock->read_depth) if (rt_mutex_real_owner(lock) != current)
__rt_spin_lock(lock); __rt_spin_lock(lock);
rwlock->read_depth++; rwlock->read_depth++;
} }
...@@ -253,8 +253,6 @@ void __lockfunc rt_read_unlock(rwlock_t *rwlock) ...@@ -253,8 +253,6 @@ void __lockfunc rt_read_unlock(rwlock_t *rwlock)
{ {
rwlock_release(&rwlock->dep_map, 1, _RET_IP_); rwlock_release(&rwlock->dep_map, 1, _RET_IP_);
BUG_ON(rwlock->read_depth <= 0);
/* Release the lock only when read_depth is down to 0 */ /* Release the lock only when read_depth is down to 0 */
if (--rwlock->read_depth == 0) if (--rwlock->read_depth == 0)
__rt_spin_unlock(&rwlock->lock); __rt_spin_unlock(&rwlock->lock);
......
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