Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH rdma-next] RDMA/umem: Silence build warning on i386 architecture
@ 2021-01-06 12:20 Leon Romanovsky
  2021-01-08 20:28 ` Jason Gunthorpe
  0 siblings, 1 reply; 3+ messages in thread
From: Leon Romanovsky @ 2021-01-06 12:20 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe; +Cc: Leon Romanovsky, linux-rdma

From: Leon Romanovsky <leonro@nvidia.com>

Sacrifice one page in order to silence compilation failure on i386
architecture.

drivers/infiniband/core/umem.c:205 __ib_umem_get() warn: impossible
			condition '(npages > (~0)) => (0-u32max > u32max)'

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 drivers/infiniband/core/umem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c
index 313fabb9f4a2..95be8cc75d2e 100644
--- a/drivers/infiniband/core/umem.c
+++ b/drivers/infiniband/core/umem.c
@@ -202,7 +202,7 @@ static struct ib_umem *__ib_umem_get(struct ib_device *device,
 	}
 
 	npages = ib_umem_num_pages(umem);
-	if (npages == 0 || npages > UINT_MAX) {
+	if (npages == 0 || npages >= UINT_MAX) {
 		ret = -EINVAL;
 		goto out;
 	}
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-11  6:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-06 12:20 [PATCH rdma-next] RDMA/umem: Silence build warning on i386 architecture Leon Romanovsky
2021-01-08 20:28 ` Jason Gunthorpe
2021-01-11  6:41   ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox