All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Doug Ledford <dledford@redhat.com>, Jason Gunthorpe <jgg@nvidia.com>
Cc: Leon Romanovsky <leonro@nvidia.com>, linux-rdma@vger.kernel.org
Subject: [PATCH rdma-next] RDMA/mlx5: Silence the overflow warning while building offset mask
Date: Wed, 25 Nov 2020 08:17:04 +0200	[thread overview]
Message-ID: <20201125061704.6580-1-leon@kernel.org> (raw)

From: Leon Romanovsky <leonro@nvidia.com>

The 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.

Fixes: b045db62f6f6 ("RDMA/mlx5: Use ib_umem_find_best_pgoff() for SRQ")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 drivers/infiniband/hw/mlx5/mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
 
-- 
2.28.0


             reply	other threads:[~2020-11-25  6:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25  6:17 Leon Romanovsky [this message]
2020-11-26 19:57 ` [PATCH rdma-next] RDMA/mlx5: Silence the overflow warning while building offset mask Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201125061704.6580-1-leon@kernel.org \
    --to=leon@kernel.org \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=leonro@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.