summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx5/mem.c
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@nvidia.com>2020-11-25 07:17:04 +0100
committerJason Gunthorpe <jgg@nvidia.com>2020-11-26 20:49:05 +0100
commitd4b2d19dc53ecb5ef4fe79cc2d4b7ae3413b2604 (patch)
treed708da8f7f8294e0ec4ad8db0687a9eb828636bf /drivers/infiniband/hw/mlx5/mem.c
parentRDMA/mlx5: Check for ERR_PTR from uverbs_zalloc() (diff)
downloadlinux-d4b2d19dc53ecb5ef4fe79cc2d4b7ae3413b2604.tar.xz
linux-d4b2d19dc53ecb5ef4fe79cc2d4b7ae3413b2604.zip
RDMA/mlx5: Silence the overflow warning while building offset mask
Coverity reports "Potentially overflowing expression ..." warning, which is correct thing to complain from the compiler point of view, but this is not possible in the current code. Still, this is a small error as there are some future situations that might need to use a 32 bit offset. Use ULL so the calculation works up to 63. Fixes: b045db62f6f6 ("RDMA/mlx5: Use ib_umem_find_best_pgoff() for SRQ") Link: https://lore.kernel.org/r/20201125061704.6580-1-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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx5/mem.c b/drivers/infiniband/hw/mlx5/mem.c
index f8ec5156d8e9..844545064c9e 100644
--- a/drivers/infiniband/hw/mlx5/mem.c
+++ b/drivers/infiniband/hw/mlx5/mem.c
@@ -62,7 +62,7 @@ unsigned long __mlx5_umem_find_best_quantized_pgoff(
unsigned int page_offset_bits, u64 pgoff_bitmask, unsigned int scale,
unsigned int *page_offset_quantized)
{
- const u64 page_offset_mask = (1 << page_offset_bits) - 1;
+ const u64 page_offset_mask = (1UL << page_offset_bits) - 1;
unsigned long page_size;
u64 page_offset;