OSDN Git Service

mlx5: avoid 64-bit division
authorMichal Kubecek <mkubecek@suse.cz>
Mon, 20 May 2019 11:19:02 +0000 (13:19 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 29 May 2019 16:03:21 +0000 (13:03 -0300)
commit37eb86c4507abcb14fc346863e83aa8751aa4675
treea78d5164545ca1afe026ca5f76bae6e188072c77
parent97736f36dbebf2cda2799db3b54717ba5b388255
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>
drivers/infiniband/hw/mlx5/cmd.c
drivers/infiniband/hw/mlx5/main.c