diff options
author | Michal Kubecek <mkubecek@suse.cz> | 2019-05-20 13:19:02 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2019-05-29 13:03:21 -0300 |
commit | 37eb86c4507abcb14fc346863e83aa8751aa4675 (patch) | |
tree | a78d5164545ca1afe026ca5f76bae6e188072c77 /drivers/infiniband/hw/mlx5/main.c | |
parent | 97736f36dbebf2cda2799db3b54717ba5b388255 (diff) | |
download | linux-37eb86c4507abcb14fc346863e83aa8751aa4675.tar.bz2 |
mlx5: avoid 64-bit division
Commit 25c13324d03d ("IB/mlx5: Add steering SW ICM device memory type")
breaks i386 build by introducing three 64-bit divisions. As the divisor is
MLX5_SW_ICM_BLOCK_SIZE() which is always a power of 2, we can replace the
division with bit operations.
Fixes: 25c13324d03d ("IB/mlx5: Add steering SW ICM device memory type")
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx5/main.c')
-rw-r--r-- | drivers/infiniband/hw/mlx5/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index abac70ad5c7c..340290b883fe 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -2344,7 +2344,7 @@ static int handle_alloc_dm_sw_icm(struct ib_ucontext *ctx, /* Allocation size must a multiple of the basic block size * and a power of 2. */ - act_size = roundup(attr->length, MLX5_SW_ICM_BLOCK_SIZE(dm_db->dev)); + act_size = round_up(attr->length, MLX5_SW_ICM_BLOCK_SIZE(dm_db->dev)); act_size = roundup_pow_of_two(act_size); dm->size = act_size; |