Skip to content

Commit

Permalink
RDMA/ib_srpt: Unify checking rdma_cm_id condition in srpt_cm_req_recv()
Browse files Browse the repository at this point in the history
Although rdma_cm_id and ib_cm_id passing to srpt_cm_req_recv() are
exclusive currently, all other checking condition are using rdma_cm_id.
So unify the 'if' condition to make the code more clear.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Li Zhijian <[email protected]>
Reviewed-by: Bart Van Assche <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
  • Loading branch information
zhijianli88 authored and jgunthorpe committed Aug 2, 2022
1 parent fd5382c commit 6b822d4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/infiniband/ulp/srpt/ib_srpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2218,13 +2218,13 @@ static int srpt_cm_req_recv(struct srpt_device *const sdev,
ch->zw_cqe.done = srpt_zerolength_write_done;
INIT_WORK(&ch->release_work, srpt_release_channel_work);
ch->sport = sport;
if (ib_cm_id) {
ch->ib_cm.cm_id = ib_cm_id;
ib_cm_id->context = ch;
} else {
if (rdma_cm_id) {
ch->using_rdma_cm = true;
ch->rdma_cm.cm_id = rdma_cm_id;
rdma_cm_id->context = ch;
} else {
ch->ib_cm.cm_id = ib_cm_id;
ib_cm_id->context = ch;
}
/*
* ch->rq_size should be at least as large as the initiator queue
Expand Down

0 comments on commit 6b822d4

Please sign in to comment.