Skip to content

Commit 6b822d4

Browse files
zhijianli88jgunthorpe
authored andcommitted
RDMA/ib_srpt: Unify checking rdma_cm_id condition in srpt_cm_req_recv()
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]>
1 parent fd5382c commit 6b822d4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/infiniband/ulp/srpt/ib_srpt.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,13 +2218,13 @@ static int srpt_cm_req_recv(struct srpt_device *const sdev,
22182218
ch->zw_cqe.done = srpt_zerolength_write_done;
22192219
INIT_WORK(&ch->release_work, srpt_release_channel_work);
22202220
ch->sport = sport;
2221-
if (ib_cm_id) {
2222-
ch->ib_cm.cm_id = ib_cm_id;
2223-
ib_cm_id->context = ch;
2224-
} else {
2221+
if (rdma_cm_id) {
22252222
ch->using_rdma_cm = true;
22262223
ch->rdma_cm.cm_id = rdma_cm_id;
22272224
rdma_cm_id->context = ch;
2225+
} else {
2226+
ch->ib_cm.cm_id = ib_cm_id;
2227+
ib_cm_id->context = ch;
22282228
}
22292229
/*
22302230
* ch->rq_size should be at least as large as the initiator queue

0 commit comments

Comments
 (0)