aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hns/hns_roce_alloc.c
diff options
context:
space:
mode:
authorXi Wang <wangxi11@huawei.com>2020-05-08 17:45:58 +0800
committerJason Gunthorpe <jgg@mellanox.com>2020-05-19 20:54:59 -0300
commit9581a356ccadb24d4a18c62c5c8327997e47241e (patch)
treebb9e4342446a423c3b969e0c63baa96ce1b0d016 /drivers/infiniband/hw/hns/hns_roce_alloc.c
parentRDMA/hns: Remove redundant memcpy() (diff)
downloadlinux-dev-9581a356ccadb24d4a18c62c5c8327997e47241e.tar.xz
linux-dev-9581a356ccadb24d4a18c62c5c8327997e47241e.zip
RDMA/hns: Rename macro for defining hns hardware page size
Rename the PAGE_ADDR_SHIFT as HNS_HW_PAGE_SHIFT to make code more readable. Link: https://lore.kernel.org/r/1588931159-56875-9-git-send-email-liweihang@huawei.com Signed-off-by: Xi Wang <wangxi11@huawei.com> Signed-off-by: Weihang Li <liweihang@huawei.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/hns/hns_roce_alloc.c')
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_alloc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_alloc.c b/drivers/infiniband/hw/hns/hns_roce_alloc.c
index 365e7db6c498..742aee846676 100644
--- a/drivers/infiniband/hw/hns/hns_roce_alloc.c
+++ b/drivers/infiniband/hw/hns/hns_roce_alloc.c
@@ -189,8 +189,8 @@ int hns_roce_buf_alloc(struct hns_roce_dev *hr_dev, u32 size, u32 max_direct,
u32 page_size;
int i;
- /* The minimum shift of the page accessed by hw is PAGE_ADDR_SHIFT */
- buf->page_shift = max_t(int, PAGE_ADDR_SHIFT, page_shift);
+ /* The minimum shift of the page accessed by hw is HNS_HW_PAGE_SHIFT */
+ buf->page_shift = max_t(int, HNS_HW_PAGE_SHIFT, page_shift);
page_size = 1 << buf->page_shift;
buf->npages = DIV_ROUND_UP(size, page_size);
@@ -261,7 +261,7 @@ int hns_roce_get_umem_bufs(struct hns_roce_dev *hr_dev, dma_addr_t *bufs,
int idx = 0;
u64 addr;
- if (page_shift < PAGE_ADDR_SHIFT) {
+ if (page_shift < HNS_HW_PAGE_SHIFT) {
dev_err(hr_dev->dev, "Failed to check umem page shift %d!\n",
page_shift);
return -EINVAL;