summaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/mlx5/devx.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2020-10-26 16:19:36 +0300
committerJason Gunthorpe <jgg@nvidia.com>2020-11-02 21:52:26 +0300
commitf8fb3110635c91a375399450dc5a4a79a83b0414 (patch)
tree1b1815753d6c0a4c4a2c2df4a79d93073dc244e6 /drivers/infiniband/hw/mlx5/devx.c
parent7db0eea916dcc050811f7a498b4e268d764c6d24 (diff)
downloadlinux-f8fb3110635c91a375399450dc5a4a79a83b0414.tar.xz
RDMA/mlx5: Remove npages from mlx5_ib_cont_pages()
Most callers don't need this, and the few that do can get it as ib_umem_num_pages(umem). Link: https://lore.kernel.org/r/20201026131936.1335664-8-leon@kernel.org Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx5/devx.c')
-rw-r--r--drivers/infiniband/hw/mlx5/devx.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/infiniband/hw/mlx5/devx.c b/drivers/infiniband/hw/mlx5/devx.c
index 7d99b5b298da..ae889266acf1 100644
--- a/drivers/infiniband/hw/mlx5/devx.c
+++ b/drivers/infiniband/hw/mlx5/devx.c
@@ -2056,7 +2056,6 @@ static int devx_umem_get(struct mlx5_ib_dev *dev, struct ib_ucontext *ucontext,
u64 addr;
size_t size;
u32 access;
- int npages;
int err;
u32 page_mask;
@@ -2081,14 +2080,7 @@ static int devx_umem_get(struct mlx5_ib_dev *dev, struct ib_ucontext *ucontext,
return PTR_ERR(obj->umem);
mlx5_ib_cont_pages(obj->umem, obj->umem->address,
- MLX5_MKEY_PAGE_SHIFT_MASK, &npages,
- &obj->page_shift);
-
- if (!npages) {
- ib_umem_release(obj->umem);
- return -EINVAL;
- }
-
+ MLX5_MKEY_PAGE_SHIFT_MASK, &obj->page_shift);
page_mask = (1 << obj->page_shift) - 1;
obj->page_offset = obj->umem->address & page_mask;