diff options
author | Ishai Rabinovitz <ishai@mellanox.co.il> | 2006-06-18 05:37:31 +0200 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-06-18 05:37:31 +0200 |
commit | 0c5b395239cdea4db3d9c23a5738fdaf3b9ada4c (patch) | |
tree | 92262c3a2480603bee7e8b8b405a3a4060433315 /drivers/infiniband | |
parent | IB: Make needlessly global ib_mad_cache static (diff) | |
download | linux-0c5b395239cdea4db3d9c23a5738fdaf3b9ada4c.tar.xz linux-0c5b395239cdea4db3d9c23a5738fdaf3b9ada4c.zip |
IB/srp: Clean up loop in srp_remove_one()
Interrupts will always be enabled in srp_remove_one(), so
spin_lock_irq() can be used instead of spin_lock_irqsave().
Also, the loop takes target->scsi_host->host_lock, so target->state
can just be set to SRP_TARGET_REMOVED witout testing the old value.
Signed-off-by: Ishai Rabinovitz <ishai@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/ulp/srp/ib_srp.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index ae1ab6acf460..46292561c44c 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -1850,7 +1850,6 @@ static void srp_remove_one(struct ib_device *device) struct srp_host *host, *tmp_host; LIST_HEAD(target_list); struct srp_target_port *target, *tmp_target; - unsigned long flags; srp_dev = ib_get_client_data(device, &srp_client); @@ -1868,10 +1867,9 @@ static void srp_remove_one(struct ib_device *device) */ spin_lock(&host->target_lock); list_for_each_entry(target, &host->target_list, list) { - spin_lock_irqsave(target->scsi_host->host_lock, flags); - if (target->state != SRP_TARGET_REMOVED) - target->state = SRP_TARGET_REMOVED; - spin_unlock_irqrestore(target->scsi_host->host_lock, flags); + spin_lock_irq(target->scsi_host->host_lock); + target->state = SRP_TARGET_REMOVED; + spin_unlock_irq(target->scsi_host->host_lock); } spin_unlock(&host->target_lock); |