diff options
author | Jason Gunthorpe <jgg@nvidia.com> | 2020-10-26 15:19:34 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2020-11-02 14:52:26 -0400 |
commit | 95741ee3f0f1f437720626131d866ac8dc66ab14 (patch) | |
tree | d07409b0b8f0efe77bf7b3ac4cdcc8ca5e00b3d3 /drivers/infiniband/hw/mlx5/mem.c | |
parent | f0093fb1a7cbff4bbfa47c1499a9e76f75359dbe (diff) |
RDMA/mlx5: Remove order from mlx5_ib_cont_pages()
Only alloc_mr_from_cache() needs order and can trivially compute it, so
lift it to the one call site and remove the NULL arguments.
Link: https://lore.kernel.org/r/20201026131936.1335664-6-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/mem.c')
-rw-r--r-- | drivers/infiniband/hw/mlx5/mem.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/infiniband/hw/mlx5/mem.c b/drivers/infiniband/hw/mlx5/mem.c index e63af1b05c0b..2faee44cca99 100644 --- a/drivers/infiniband/hw/mlx5/mem.c +++ b/drivers/infiniband/hw/mlx5/mem.c @@ -42,12 +42,11 @@ * @count: number of PAGE_SIZE pages covered by umem * @shift: page shift for the compound pages found in the region * @ncont: number of compund pages - * @order: log2 of the number of compound pages */ void mlx5_ib_cont_pages(struct ib_umem *umem, u64 addr, unsigned long max_page_shift, int *count, int *shift, - int *ncont, int *order) + int *ncont) { unsigned long tmp; unsigned long m; @@ -63,8 +62,6 @@ void mlx5_ib_cont_pages(struct ib_umem *umem, u64 addr, *shift = odp->page_shift; *ncont = ib_umem_odp_num_pages(odp); *count = *ncont << (*shift - PAGE_SHIFT); - if (order) - *order = ilog2(roundup_pow_of_two(*count)); return; } @@ -95,17 +92,9 @@ void mlx5_ib_cont_pages(struct ib_umem *umem, u64 addr, if (i) { m = min_t(unsigned long, ilog2(roundup_pow_of_two(i)), m); - - if (order) - *order = ilog2(roundup_pow_of_two(i) >> m); - *ncont = DIV_ROUND_UP(i, (1 << m)); } else { m = 0; - - if (order) - *order = 0; - *ncont = 0; } *shift = PAGE_SHIFT + m; |