From: Guoqing Jiang <guoqing.jiang@xxxxxxxxxxxxxxx> There is no need to dereference 's' from 'sess', since we have "sess = to_clt_sess(s)" before. And we can deference 'dev' from 's' earlier. Signed-off-by: Guoqing Jiang <guoqing.jiang@xxxxxxxxx> Reviewed-by: Danil Kipnis <danil.kipnis@xxxxxxxxx> Signed-off-by: Gioh Kim <gi-oh.kim@xxxxxxxxx> Signed-off-by: Jack Wang <jinpu.wang@xxxxxxxxx> --- drivers/infiniband/ulp/rtrs/rtrs-clt.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c index bfb5be5481e7..dd841121dc2c 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c @@ -1055,7 +1055,7 @@ static int rtrs_clt_read_req(struct rtrs_clt_io_req *req) struct rtrs_sess *s = con->c.sess; struct rtrs_clt_sess *sess = to_clt_sess(s); struct rtrs_msg_rdma_read *msg; - struct rtrs_ib_dev *dev; + struct rtrs_ib_dev *dev = sess->s.dev; struct ib_reg_wr rwr; struct ib_send_wr *wr = NULL; @@ -1065,9 +1065,6 @@ static int rtrs_clt_read_req(struct rtrs_clt_io_req *req) const size_t tsize = sizeof(*msg) + req->data_len + req->usr_len; - s = &sess->s; - dev = sess->s.dev; - if (unlikely(tsize > sess->chunk_size)) { rtrs_wrn(s, "Read request failed, message size is %zu, bigger than CHUNK_SIZE %d\n", -- 2.25.1