Re: [PATCH] RDMA/umem: Fix the ib_umem_dmabuf_get() prototype

Leon Romanovsky <[email protected]> Mon, 20 Jul 2026 16:01:58 +0300
Newsgroups org.kernel.vger.kernel-janitors,org.kernel.vger.linux-kernel,org.kernel.vger.linux-rdma
Message-ID <20260720130158.GF110966@unreal>
On Sun, Jul 19, 2026 at 11:16:17PM +0200, Christophe JAILLET wrote:
> If CONFIG_INFINIBAND_USER_MEM is not defined, then the last parameter of
> ib_umem_dmabuf_get() is missing a const qualifier in order to match its
> prototype.
> 
> This is an issue since commit dcae56cfecc6 ("RDMA/mlx5: Constify struct
> ib_frmr_pool_ops and dma_buf_attach_ops") because now a "const struct
> dma_buf_attach_ops *o" can really be passed to the function.
> 
> Fixes: dcae56cfecc6 ("RDMA/mlx5: Constify struct ib_frmr_pool_ops and dma_buf_attach_ops")

I squashed that fix to the problematic commit.

Thanks

> Signed-off-by: Christophe JAILLET <[email protected]>
> ---
>  include/rdma/ib_umem.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/rdma/ib_umem.h b/include/rdma/ib_umem.h
> index 31b3a86fe73a..1fe87fd1d769 100644
> --- a/include/rdma/ib_umem.h
> +++ b/include/rdma/ib_umem.h
> @@ -250,7 +250,7 @@ struct ib_umem_dmabuf *ib_umem_dmabuf_get(struct ib_device *device,
>  					  unsigned long offset,
>  					  size_t size, int fd,
>  					  int access,
> -					  struct dma_buf_attach_ops *ops)
> +					  const struct dma_buf_attach_ops *ops)
>  {
>  	return ERR_PTR(-EOPNOTSUPP);
>  }
> -- 
> 2.55.0
>