xen-pciback: Cleanup up pcistub_put_pci_dev
[linux-2.6-microblaze.git] / kernel / locking / mutex-debug.c
index e1191c9..5cf6731 100644 (file)
@@ -71,18 +71,17 @@ void mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter,
 
 void debug_mutex_unlock(struct mutex *lock)
 {
-       if (unlikely(!debug_locks))
-               return;
+       if (likely(debug_locks)) {
+               DEBUG_LOCKS_WARN_ON(lock->magic != lock);
 
-       DEBUG_LOCKS_WARN_ON(lock->magic != lock);
+               if (!lock->owner)
+                       DEBUG_LOCKS_WARN_ON(!lock->owner);
+               else
+                       DEBUG_LOCKS_WARN_ON(lock->owner != current);
 
-       if (!lock->owner)
-               DEBUG_LOCKS_WARN_ON(!lock->owner);
-       else
-               DEBUG_LOCKS_WARN_ON(lock->owner != current);
-
-       DEBUG_LOCKS_WARN_ON(!lock->wait_list.prev && !lock->wait_list.next);
-       mutex_clear_owner(lock);
+               DEBUG_LOCKS_WARN_ON(!lock->wait_list.prev && !lock->wait_list.next);
+               mutex_clear_owner(lock);
+       }
 
        /*
         * __mutex_slowpath_needs_to_unlock() is explicitly 0 for debug