Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sgi-xp: Replace spin_is_locked() with lockdep

lockdep_assert_held() is better suited to checking locking requirements,
since it won't get confused when someone else holds the lock. This is
also a step towards possibly removing spin_is_locked().

Signed-off-by: Lance Roy <ldr709@gmail.com>
Cc: Cliff Whickman <cpw@sgi.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Acked-by: Robin Holt <robinmholt@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Lance Roy and committed by
Greg Kroah-Hartman
f2199625 3b7584a2

+5 -5
+3 -3
drivers/misc/sgi-xp/xpc_channel.c
··· 28 28 { 29 29 enum xp_retval ret; 30 30 31 - DBUG_ON(!spin_is_locked(&ch->lock)); 31 + lockdep_assert_held(&ch->lock); 32 32 33 33 if (!(ch->flags & XPC_C_OPENREQUEST) || 34 34 !(ch->flags & XPC_C_ROPENREQUEST)) { ··· 82 82 struct xpc_partition *part = &xpc_partitions[ch->partid]; 83 83 u32 channel_was_connected = (ch->flags & XPC_C_WASCONNECTED); 84 84 85 - DBUG_ON(!spin_is_locked(&ch->lock)); 85 + lockdep_assert_held(&ch->lock); 86 86 87 87 if (!(ch->flags & XPC_C_DISCONNECTING)) 88 88 return; ··· 755 755 { 756 756 u32 channel_was_connected = (ch->flags & XPC_C_CONNECTED); 757 757 758 - DBUG_ON(!spin_is_locked(&ch->lock)); 758 + lockdep_assert_held(&ch->lock); 759 759 760 760 if (ch->flags & (XPC_C_DISCONNECTING | XPC_C_DISCONNECTED)) 761 761 return;
+1 -1
drivers/misc/sgi-xp/xpc_sn2.c
··· 1671 1671 { 1672 1672 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; 1673 1673 1674 - DBUG_ON(!spin_is_locked(&ch->lock)); 1674 + lockdep_assert_held(&ch->lock); 1675 1675 1676 1676 ch_sn2->remote_msgqueue_pa = 0; 1677 1677
+1 -1
drivers/misc/sgi-xp/xpc_uv.c
··· 1183 1183 { 1184 1184 struct xpc_channel_uv *ch_uv = &ch->sn.uv; 1185 1185 1186 - DBUG_ON(!spin_is_locked(&ch->lock)); 1186 + lockdep_assert_held(&ch->lock); 1187 1187 1188 1188 kfree(ch_uv->cached_notify_gru_mq_desc); 1189 1189 ch_uv->cached_notify_gru_mq_desc = NULL;