diff options
author | Bart Van Assche <bart.vanassche@sandisk.com> | 2015-05-18 14:26:17 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-05-18 20:35:56 +0300 |
commit | bbac5ccff43cdcb5fc9346669ec67ea47fca3de0 (patch) | |
tree | e2d4db16b71c0a774343cd9306328b586b44d926 | |
parent | 47513cf4f4a4a9d1db2823de9c5864f834dbaecf (diff) | |
download | linux-bbac5ccff43cdcb5fc9346669ec67ea47fca3de0.tar.xz |
IB/srp: Remove !ch->target tests from the reconnect code
Remove the !ch->target tests from the reconnect code. These
tests are not needed: upon entry of srp_rport_reconnect()
it is guaranteed that all ch->target pointers are non-NULL.
None of the functions srp_new_cm_id(), srp_finish_req(),
srp_create_ch_ib() nor srp_connect_ch() modifies this pointer.
srp_free_ch_ib() is never called concurrently with
srp_rport_reconnect().
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Cc: Sebastian Parschauer <sebastian.riemer@profitbricks.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r-- | drivers/infiniband/ulp/srp/ib_srp.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index af39e68c1bbd..3c8d8b261035 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -1210,14 +1210,10 @@ static int srp_rport_reconnect(struct srp_rport *rport) */ for (i = 0; i < target->ch_count; i++) { ch = &target->ch[i]; - if (!ch->target) - break; ret += srp_new_cm_id(ch); } for (i = 0; i < target->ch_count; i++) { ch = &target->ch[i]; - if (!ch->target) - break; for (j = 0; j < target->req_ring_size; ++j) { struct srp_request *req = &ch->req_ring[j]; @@ -1226,8 +1222,6 @@ static int srp_rport_reconnect(struct srp_rport *rport) } for (i = 0; i < target->ch_count; i++) { ch = &target->ch[i]; - if (!ch->target) - break; /* * Whether or not creating a new CM ID succeeded, create a new * QP. This guarantees that all completion callback function @@ -1244,7 +1238,7 @@ static int srp_rport_reconnect(struct srp_rport *rport) for (i = 0; i < target->ch_count; i++) { ch = &target->ch[i]; - if (ret || !ch->target) + if (ret) break; ret = srp_connect_ch(ch, multich); multich = true; |