diff mbox

[STABLE-4.4,3.18] : fix xen_swiotlb_dma_mmap prototype

Message ID 20171004135140.3720000-1-arnd@arndb.de (mailing list archive)
State New, archived
Headers show

Commit Message

Arnd Bergmann Oct. 4, 2017, 1:51 p.m. UTC
xen_swiotlb_dma_mmap was backported from v4.10, but older
kernels before commit 00085f1efa38 ("dma-mapping: use unsigned long
for dma_attrs") use a different signature:

arm/xen/mm.c:202:10: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .mmap = xen_swiotlb_dma_mmap,
          ^~~~~~~~~~~~~~~~~~~~
arm/xen/mm.c:202:10: note: (near initialization for 'xen_swiotlb_dma_ops.mmap')

This adapts the patch to the old calling conventions.

Fixes: 2f0b82b1b830 ("swiotlb-xen: implement xen_swiotlb_dma_mmap callback")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/xen/swiotlb-xen.c | 2 +-
 include/xen/swiotlb-xen.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Stefano Stabellini Oct. 4, 2017, 5:01 p.m. UTC | #1
On Wed, 4 Oct 2017, Arnd Bergmann wrote:
> xen_swiotlb_dma_mmap was backported from v4.10, but older
> kernels before commit 00085f1efa38 ("dma-mapping: use unsigned long
> for dma_attrs") use a different signature:
> 
> arm/xen/mm.c:202:10: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
>   .mmap = xen_swiotlb_dma_mmap,
>           ^~~~~~~~~~~~~~~~~~~~
> arm/xen/mm.c:202:10: note: (near initialization for 'xen_swiotlb_dma_ops.mmap')
> 
> This adapts the patch to the old calling conventions.
> 
> Fixes: 2f0b82b1b830 ("swiotlb-xen: implement xen_swiotlb_dma_mmap callback")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  drivers/xen/swiotlb-xen.c | 2 +-
>  include/xen/swiotlb-xen.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
> index 622f805fb382..f7b19c25c3a4 100644
> --- a/drivers/xen/swiotlb-xen.c
> +++ b/drivers/xen/swiotlb-xen.c
> @@ -689,7 +689,7 @@ EXPORT_SYMBOL_GPL(xen_swiotlb_set_dma_mask);
>  int
>  xen_swiotlb_dma_mmap(struct device *dev, struct vm_area_struct *vma,
>  		     void *cpu_addr, dma_addr_t dma_addr, size_t size,
> -		     unsigned long attrs)
> +		     struct dma_attrs *attrs)
>  {
>  #if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
>  	if (__generic_dma_ops(dev)->mmap)
> diff --git a/include/xen/swiotlb-xen.h b/include/xen/swiotlb-xen.h
> index fab4fb9c6442..4d7fdbf20eff 100644
> --- a/include/xen/swiotlb-xen.h
> +++ b/include/xen/swiotlb-xen.h
> @@ -62,5 +62,5 @@ xen_swiotlb_set_dma_mask(struct device *dev, u64 dma_mask);
>  extern int
>  xen_swiotlb_dma_mmap(struct device *dev, struct vm_area_struct *vma,
>  		     void *cpu_addr, dma_addr_t dma_addr, size_t size,
> -		     unsigned long attrs);
> +		     struct dma_attrs *attrs);
>  #endif /* __LINUX_SWIOTLB_XEN_H */
> -- 
> 2.9.0
>
Greg Kroah-Hartman Oct. 4, 2017, 8:15 p.m. UTC | #2
On Wed, Oct 04, 2017 at 10:01:26AM -0700, Stefano Stabellini wrote:
> On Wed, 4 Oct 2017, Arnd Bergmann wrote:
> > xen_swiotlb_dma_mmap was backported from v4.10, but older
> > kernels before commit 00085f1efa38 ("dma-mapping: use unsigned long
> > for dma_attrs") use a different signature:
> > 
> > arm/xen/mm.c:202:10: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
> >   .mmap = xen_swiotlb_dma_mmap,
> >           ^~~~~~~~~~~~~~~~~~~~
> > arm/xen/mm.c:202:10: note: (near initialization for 'xen_swiotlb_dma_ops.mmap')
> > 
> > This adapts the patch to the old calling conventions.
> > 
> > Fixes: 2f0b82b1b830 ("swiotlb-xen: implement xen_swiotlb_dma_mmap callback")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Thanks, I've added this tag to the patch.

greg k-h
diff mbox

Patch

diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index 622f805fb382..f7b19c25c3a4 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -689,7 +689,7 @@  EXPORT_SYMBOL_GPL(xen_swiotlb_set_dma_mask);
 int
 xen_swiotlb_dma_mmap(struct device *dev, struct vm_area_struct *vma,
 		     void *cpu_addr, dma_addr_t dma_addr, size_t size,
-		     unsigned long attrs)
+		     struct dma_attrs *attrs)
 {
 #if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
 	if (__generic_dma_ops(dev)->mmap)
diff --git a/include/xen/swiotlb-xen.h b/include/xen/swiotlb-xen.h
index fab4fb9c6442..4d7fdbf20eff 100644
--- a/include/xen/swiotlb-xen.h
+++ b/include/xen/swiotlb-xen.h
@@ -62,5 +62,5 @@  xen_swiotlb_set_dma_mask(struct device *dev, u64 dma_mask);
 extern int
 xen_swiotlb_dma_mmap(struct device *dev, struct vm_area_struct *vma,
 		     void *cpu_addr, dma_addr_t dma_addr, size_t size,
-		     unsigned long attrs);
+		     struct dma_attrs *attrs);
 #endif /* __LINUX_SWIOTLB_XEN_H */