RDMA/hns: Refactor mtr_init_buf_cfg()
authorChengchang Tang <tangchengchang@huawei.com>
Sat, 13 Jan 2024 08:59:31 +0000 (16:59 +0800)
committerLeon Romanovsky <leon@kernel.org>
Thu, 25 Jan 2024 09:54:38 +0000 (11:54 +0200)
commit4f5731b1fb2246719513dfb918bf71b6818aa5f5
treeb139092e9d1de800fd2824fc9f40002dc4646843
parenta4ca341080758d847db155b97887bff6f84016a4
RDMA/hns: Refactor mtr_init_buf_cfg()

page_shift and page_cnt is only used in mtr_map_bufs(). And these
parameter could be calculated indepedently.

Strip the computation of page_shift and page_cnt from mtr_init_buf_cfg(),
reducing the number of parameters of it. This helps reducing coupling
between mtr_init_buf_cfg() and mtr_map_bufs().

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://lore.kernel.org/r/20240113085935.2838701-3-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/hns/hns_roce_mr.c