]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
RDMA/siw: Fix pointer-to-int-cast warning in siw_rx_pbl()
authorTom Seewald <tseewald@gmail.com>
Wed, 10 Jun 2020 17:47:17 +0000 (12:47 -0500)
committerSasha Levin <sashal@kernel.org>
Tue, 30 Jun 2020 19:36:55 +0000 (15:36 -0400)
[ Upstream commit 6769b275a313c76ddcd7d94c632032326db5f759 ]

The variable buf_addr is type dma_addr_t, which may not be the same size
as a pointer.  To ensure it is the correct size, cast to a uintptr_t.

Fixes: c536277e0db1 ("RDMA/siw: Fix 64/32bit pointer inconsistency")
Link: https://lore.kernel.org/r/20200610174717.15932-1-tseewald@gmail.com
Signed-off-by: Tom Seewald <tseewald@gmail.com>
Reviewed-by: Bernard Metzler <bmt@zurich.ibm.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/sw/siw/siw_qp_rx.c

index c0a887240325854bb9af0de94d2e86ff6c9e0f4f..0520e70084f9746c9b247e0c49ae2e8f6c006487 100644 (file)
@@ -139,7 +139,8 @@ static int siw_rx_pbl(struct siw_rx_stream *srx, int *pbl_idx,
                        break;
 
                bytes = min(bytes, len);
-               if (siw_rx_kva(srx, (void *)buf_addr, bytes) == bytes) {
+               if (siw_rx_kva(srx, (void *)(uintptr_t)buf_addr, bytes) ==
+                   bytes) {
                        copied += bytes;
                        offset += bytes;
                        len -= bytes;