[13/15] xen/gntdev-dmabuf: Ditch dummy map functions
diff mbox series

Message ID 20191118103536.17675-14-daniel.vetter@ffwll.ch
State New
Headers show
Series
  • Retire dma_buf_k(un)map
Related show

Commit Message

Daniel Vetter Nov. 18, 2019, 10:35 a.m. UTC
There's no in-kernel users for the k(un)map stuff. And the mmap one is
actively harmful - return 0 and then _not_ actually mmaping can't end
well.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org
--
Ack for merging this through drm trees very much appreciated.
-Daniel
---
 drivers/xen/gntdev-dmabuf.c | 23 -----------------------
 1 file changed, 23 deletions(-)

Comments

Oleksandr Andrushchenko Nov. 18, 2019, 10:50 a.m. UTC | #1
On 11/18/19 12:35 PM, Daniel Vetter wrote:
> There's no in-kernel users for the k(un)map stuff. And the mmap one is
> actively harmful - return 0 and then _not_ actually mmaping can't end
> well.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: Juergen Gross <jgross@suse.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: xen-devel@lists.xenproject.org
> --
> Ack for merging this through drm trees very much appreciated.
> -Daniel
> ---
>   drivers/xen/gntdev-dmabuf.c | 23 -----------------------
>   1 file changed, 23 deletions(-)
>
> diff --git a/drivers/xen/gntdev-dmabuf.c b/drivers/xen/gntdev-dmabuf.c
> index 2c4f324f8626..fe7bd69d6955 100644
> --- a/drivers/xen/gntdev-dmabuf.c
> +++ b/drivers/xen/gntdev-dmabuf.c
> @@ -342,35 +342,12 @@ static void dmabuf_exp_ops_release(struct dma_buf *dma_buf)
>   	mutex_unlock(&priv->lock);
>   }
>   
> -static void *dmabuf_exp_ops_kmap(struct dma_buf *dma_buf,
> -				 unsigned long page_num)
> -{
> -	/* Not implemented. */
> -	return NULL;
> -}
> -
> -static void dmabuf_exp_ops_kunmap(struct dma_buf *dma_buf,
> -				  unsigned long page_num, void *addr)
> -{
> -	/* Not implemented. */
> -}
> -
> -static int dmabuf_exp_ops_mmap(struct dma_buf *dma_buf,
> -			       struct vm_area_struct *vma)
> -{
> -	/* Not implemented. */
> -	return 0;
> -}
> -
>   static const struct dma_buf_ops dmabuf_exp_ops =  {
>   	.attach = dmabuf_exp_ops_attach,
>   	.detach = dmabuf_exp_ops_detach,
>   	.map_dma_buf = dmabuf_exp_ops_map_dma_buf,
>   	.unmap_dma_buf = dmabuf_exp_ops_unmap_dma_buf,
>   	.release = dmabuf_exp_ops_release,
> -	.map = dmabuf_exp_ops_kmap,
> -	.unmap = dmabuf_exp_ops_kunmap,
> -	.mmap = dmabuf_exp_ops_mmap,
>   };
>   
>   struct gntdev_dmabuf_export_args {
Juergen Gross Nov. 18, 2019, 10:53 a.m. UTC | #2
On 18.11.19 11:35, Daniel Vetter wrote:
> There's no in-kernel users for the k(un)map stuff. And the mmap one is
> actively harmful - return 0 and then _not_ actually mmaping can't end
> well.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: Juergen Gross <jgross@suse.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: xen-devel@lists.xenproject.org

Reviewed-by: Juergen Gross <jgross@suse.com>

> --
> Ack for merging this through drm trees very much appreciated.

Yes, I'm fine with that.


Juergen

Patch
diff mbox series

diff --git a/drivers/xen/gntdev-dmabuf.c b/drivers/xen/gntdev-dmabuf.c
index 2c4f324f8626..fe7bd69d6955 100644
--- a/drivers/xen/gntdev-dmabuf.c
+++ b/drivers/xen/gntdev-dmabuf.c
@@ -342,35 +342,12 @@  static void dmabuf_exp_ops_release(struct dma_buf *dma_buf)
 	mutex_unlock(&priv->lock);
 }
 
-static void *dmabuf_exp_ops_kmap(struct dma_buf *dma_buf,
-				 unsigned long page_num)
-{
-	/* Not implemented. */
-	return NULL;
-}
-
-static void dmabuf_exp_ops_kunmap(struct dma_buf *dma_buf,
-				  unsigned long page_num, void *addr)
-{
-	/* Not implemented. */
-}
-
-static int dmabuf_exp_ops_mmap(struct dma_buf *dma_buf,
-			       struct vm_area_struct *vma)
-{
-	/* Not implemented. */
-	return 0;
-}
-
 static const struct dma_buf_ops dmabuf_exp_ops =  {
 	.attach = dmabuf_exp_ops_attach,
 	.detach = dmabuf_exp_ops_detach,
 	.map_dma_buf = dmabuf_exp_ops_map_dma_buf,
 	.unmap_dma_buf = dmabuf_exp_ops_unmap_dma_buf,
 	.release = dmabuf_exp_ops_release,
-	.map = dmabuf_exp_ops_kmap,
-	.unmap = dmabuf_exp_ops_kunmap,
-	.mmap = dmabuf_exp_ops_mmap,
 };
 
 struct gntdev_dmabuf_export_args {