]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
sgi-xp: use lockdep_assert_held()
authorAndi Kleen <ak@linux.intel.com>
Wed, 4 Apr 2012 00:08:24 +0000 (10:08 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 11 Apr 2012 04:45:50 +0000 (14:45 +1000)
!spin_is_locked() is always true on a UP build, so it cannot be used for
assertions.  Replace with lockdep_assert_held().

I realize UP builds are not very likely for this driver, but it's still
better to fix it.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/misc/sgi-xp/xpc_channel.c
drivers/misc/sgi-xp/xpc_sn2.c
drivers/misc/sgi-xp/xpc_uv.c

index 652593fc486d69f3fc3cd7c50df2f9d7e4fc8a20..1655c211e8d09ebb756f235f48cec205b450b9f1 100644 (file)
@@ -28,7 +28,7 @@ xpc_process_connect(struct xpc_channel *ch, unsigned long *irq_flags)
 {
        enum xp_retval ret;
 
-       DBUG_ON(!spin_is_locked(&ch->lock));
+       lockdep_assert_held(&ch->lock);
 
        if (!(ch->flags & XPC_C_OPENREQUEST) ||
            !(ch->flags & XPC_C_ROPENREQUEST)) {
@@ -82,7 +82,7 @@ xpc_process_disconnect(struct xpc_channel *ch, unsigned long *irq_flags)
        struct xpc_partition *part = &xpc_partitions[ch->partid];
        u32 channel_was_connected = (ch->flags & XPC_C_WASCONNECTED);
 
-       DBUG_ON(!spin_is_locked(&ch->lock));
+       lockdep_assert_held(&ch->lock);
 
        if (!(ch->flags & XPC_C_DISCONNECTING))
                return;
@@ -758,7 +758,7 @@ xpc_disconnect_channel(const int line, struct xpc_channel *ch,
 {
        u32 channel_was_connected = (ch->flags & XPC_C_CONNECTED);
 
-       DBUG_ON(!spin_is_locked(&ch->lock));
+       lockdep_assert_held(&ch->lock);
 
        if (ch->flags & (XPC_C_DISCONNECTING | XPC_C_DISCONNECTED))
                return;
index 7d71c04fc938873fa1798dfcc0e6a6b7a043346a..9d3b113c253a28ae151d63f57367716bd0ebcd22 100644 (file)
@@ -1674,7 +1674,7 @@ xpc_teardown_msg_structures_sn2(struct xpc_channel *ch)
 {
        struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2;
 
-       DBUG_ON(!spin_is_locked(&ch->lock));
+       lockdep_assert_held(&ch->lock);
 
        ch_sn2->remote_msgqueue_pa = 0;
 
index 17bbacb1b4b131b119b0076b339f44012fcc51f7..666b081c815c1888ffc0045767f5cbf87a2f0bc4 100644 (file)
@@ -1181,7 +1181,7 @@ xpc_teardown_msg_structures_uv(struct xpc_channel *ch)
 {
        struct xpc_channel_uv *ch_uv = &ch->sn.uv;
 
-       DBUG_ON(!spin_is_locked(&ch->lock));
+       lockdep_assert_held(&ch->lock);
 
        kfree(ch_uv->cached_notify_gru_mq_desc);
        ch_uv->cached_notify_gru_mq_desc = NULL;