[PATCH rdma-next 1/6] RDMA/umem: Remove redundant DMABUF ops check

Leon Romanovsky posted 6 patches 1 month ago
[PATCH rdma-next 1/6] RDMA/umem: Remove redundant DMABUF ops check
Posted by Leon Romanovsky 1 month ago
From: Leon Romanovsky <leonro@nvidia.com>

ib_umem_dmabuf_get_with_dma_device() is an in-kernel function and does
not require a defensive check for the .move_notify callback. All current
callers guarantee that this callback is always present.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 drivers/infiniband/core/umem_dmabuf.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/infiniband/core/umem_dmabuf.c b/drivers/infiniband/core/umem_dmabuf.c
index 0ec2e4120cc9..939da49b0dcc 100644
--- a/drivers/infiniband/core/umem_dmabuf.c
+++ b/drivers/infiniband/core/umem_dmabuf.c
@@ -129,9 +129,6 @@ ib_umem_dmabuf_get_with_dma_device(struct ib_device *device,
 	if (check_add_overflow(offset, (unsigned long)size, &end))
 		return ret;
 
-	if (unlikely(!ops || !ops->move_notify))
-		return ret;
-
 	dmabuf = dma_buf_get(fd);
 	if (IS_ERR(dmabuf))
 		return ERR_CAST(dmabuf);

-- 
2.52.0
Re: [PATCH rdma-next 1/6] RDMA/umem: Remove redundant DMABUF ops check
Posted by Kalesh Anakkur Purayil 1 month ago
On Sun, Jan 4, 2026 at 7:22 PM Leon Romanovsky <leon@kernel.org> wrote:
>
> From: Leon Romanovsky <leonro@nvidia.com>
>
> ib_umem_dmabuf_get_with_dma_device() is an in-kernel function and does
> not require a defensive check for the .move_notify callback. All current
> callers guarantee that this callback is always present.
>
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>

Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>


-- 
Regards,
Kalesh AP