From 7cdcbc8c69ab7193b87270e8ffc262825fbfc7a0 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 28 Nov 2009 18:40:15 +0000 Subject: [PATCH] Cleanup: - Removed a spinlock that became superfluous. - Fixed checkpatch and sparse complaints. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1370 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 9 ++++----- srpt/src/ib_srpt.h | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 5cc208bcf..8e36cb8de 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -715,9 +715,9 @@ static enum srpt_command_state srpt_set_cmd_state(struct srpt_ioctx *ioctx, WARN_ON(!ioctx); WARN_ON(new == SRPT_STATE_NEW); - do + do { previous = atomic_read(&ioctx->state); - while (previous != SRPT_STATE_ABORTED + } while (previous != SRPT_STATE_ABORTED && atomic_cmpxchg(&ioctx->state, previous, new) != previous); return previous; @@ -949,7 +949,7 @@ out: static void srpt_reset_ioctx(struct srpt_rdma_ch *ch, struct srpt_ioctx *ioctx) { - srpt_unmap_sg_to_ib_sge(ch, ioctx); + srpt_unmap_sg_to_ib_sge(ch, ioctx); if (ioctx->n_rbuf > 1) { kfree(ioctx->rbufs); @@ -1650,7 +1650,7 @@ out: * a call to ib_destroy_cm_id(), which locks the cm_id spinlock and hence * waits until this function has finished). */ -void srpt_release_channel_by_cmid(struct ib_cm_id *cm_id) +static void srpt_release_channel_by_cmid(struct ib_cm_id *cm_id) { struct srpt_device *sdev; struct srpt_rdma_ch *ch; @@ -1867,7 +1867,6 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, goto reject; } - spin_lock_init(&ch->spinlock); memcpy(ch->i_port_id, req->initiator_port_id, 16); memcpy(ch->t_port_id, req->target_port_id, 16); ch->sport = &sdev->port[param->port - 1]; diff --git a/srpt/src/ib_srpt.h b/srpt/src/ib_srpt.h index 2be14addd..e7fac2420 100644 --- a/srpt/src/ib_srpt.h +++ b/srpt/src/ib_srpt.h @@ -169,7 +169,6 @@ struct srpt_rdma_ch { /* 128-bit target port identifier copied from SRP_LOGIN_REQ. */ u8 t_port_id[16]; atomic_t req_lim_delta; - spinlock_t spinlock; atomic_t state; /*enum rdma_ch_state*/ /* Node for insertion in the srpt_device::rch_list list. */ struct list_head list;