blob: 3b4ad53b0d03b21a0bd3d1f4d830ceb2ace87264 [file] [log] [blame]
From dcd880ed997a25809731ef3e36488a1da3bf4edb Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
Date: Sun, 23 Aug 2009 11:49:34 +0200
Subject: [PATCH] rt: Remove rwlocks BUG_ON and useless read_depth check
commit dcd880ed997a25809731ef3e36488a1da3bf4edb in tip.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
diff --git a/kernel/rt.c b/kernel/rt.c
index 59ca169..7da3299 100644
--- a/kernel/rt.c
+++ b/kernel/rt.c
@@ -206,7 +206,7 @@ int __lockfunc rt_read_trylock(rwlock_t *rwlock)
/*
* 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);
if (ret) {
@@ -234,7 +234,7 @@ void __lockfunc rt_read_lock(rwlock_t *rwlock)
/*
* 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);
rwlock->read_depth++;
}
@@ -253,8 +253,6 @@ void __lockfunc rt_read_unlock(rwlock_t *rwlock)
{
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 */
if (--rwlock->read_depth == 0)
__rt_spin_unlock(&rwlock->lock);
--
1.7.1.1