]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
futex: use lockdep_assert_held() for lock checking
authorAndi Kleen <ak@linux.intel.com>
Wed, 4 Apr 2012 00:08:25 +0000 (10:08 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 11 Apr 2012 04:45:50 +0000 (14:45 +1000)
Use lockdep_assert_held() for lock checking instead of a strange homegrown
variant.  This removes the return for this case, but that is unlikely to
be useful anyway.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Darren Hart <dvhart@linux.intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/futex.c

index e2b0fb9a0b3b3d0d5871ee37bf08618a6bf052e7..78cff326facc2ccb9010922d081a9f0888fa8488 100644 (file)
@@ -824,8 +824,9 @@ static void __unqueue_futex(struct futex_q *q)
 {
        struct futex_hash_bucket *hb;
 
-       if (WARN_ON_SMP(!q->lock_ptr || !spin_is_locked(q->lock_ptr))
-           || WARN_ON(plist_node_empty(&q->list)))
+       if (q->lock_ptr)
+               lockdep_assert_held(q->lock_ptr);
+       if (WARN_ON(plist_node_empty(&q->list)))
                return;
 
        hb = container_of(q->lock_ptr, struct futex_hash_bucket, lock);