* [PATCH v3 03/37] treewide: Consolidate set_dma_ops() implementations
[not found] <20170120210437.26389-1-bart.vanassche@sandisk.com>
@ 2017-01-20 21:04 ` Bart Van Assche
2017-01-30 13:58 ` Russell King - ARM Linux
0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2017-01-20 21:04 UTC (permalink / raw)
To: Doug Ledford
Cc: linux-rdma, Bart Van Assche, Benjamin Herrenschmidt,
Chris Metcalf, David Woodhouse, linux-arch, linux-arm-kernel,
linux-kernel, linuxppc-dev, Paul Mackerras, Russell King
Now that all set_dma_ops() implementations are identical (ignoring
BUG_ON() statements), remove the architecture specific definitions
and add a definition in <linux/dma-mapping.h>.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Chris Metcalf <cmetcalf@mellanox.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: linux-arch@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Paul Mackerras <paulus@samba.org>
Cc: Russell King <linux@armlinux.org.uk>
---
arch/arm/include/asm/dma-mapping.h | 6 ------
arch/powerpc/include/asm/dma-mapping.h | 5 -----
arch/tile/include/asm/dma-mapping.h | 5 -----
include/linux/dma-mapping.h | 5 +++++
4 files changed, 5 insertions(+), 16 deletions(-)
diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
index 312f4d0564d6..c7432d647e53 100644
--- a/arch/arm/include/asm/dma-mapping.h
+++ b/arch/arm/include/asm/dma-mapping.h
@@ -31,12 +31,6 @@ static inline const struct dma_map_ops *get_dma_ops(struct device *dev)
return __generic_dma_ops(dev);
}
-static inline void set_dma_ops(struct device *dev, const struct dma_map_ops *ops)
-{
- BUG_ON(!dev);
- dev->dma_ops = ops;
-}
-
#define HAVE_ARCH_DMA_SUPPORTED 1
extern int dma_supported(struct device *dev, u64 mask);
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
index 59fbd4abcbf8..8275603ba4d5 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -91,11 +91,6 @@ static inline const struct dma_map_ops *get_dma_ops(struct device *dev)
return dev->dma_ops;
}
-static inline void set_dma_ops(struct device *dev, const struct dma_map_ops *ops)
-{
- dev->dma_ops = ops;
-}
-
/*
* get_dma_offset()
*
diff --git a/arch/tile/include/asm/dma-mapping.h b/arch/tile/include/asm/dma-mapping.h
index c0620697eaad..2562995a6ac9 100644
--- a/arch/tile/include/asm/dma-mapping.h
+++ b/arch/tile/include/asm/dma-mapping.h
@@ -59,11 +59,6 @@ static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr)
static inline void dma_mark_clean(void *addr, size_t size) {}
-static inline void set_dma_ops(struct device *dev, const struct dma_map_ops *ops)
-{
- dev->dma_ops = ops;
-}
-
static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
{
if (!dev->dma_mask)
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index f1da68b82c63..e97f23e8b2d9 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -164,6 +164,11 @@ int dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma,
#ifdef CONFIG_HAS_DMA
#include <asm/dma-mapping.h>
+static inline void set_dma_ops(struct device *dev,
+ const struct dma_map_ops *dma_ops)
+{
+ dev->dma_ops = dma_ops;
+}
#else
/*
* Define the dma api to allow compilation but not linking of
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v3 03/37] treewide: Consolidate set_dma_ops() implementations
2017-01-20 21:04 ` [PATCH v3 03/37] treewide: Consolidate set_dma_ops() implementations Bart Van Assche
@ 2017-01-30 13:58 ` Russell King - ARM Linux
0 siblings, 0 replies; 2+ messages in thread
From: Russell King - ARM Linux @ 2017-01-30 13:58 UTC (permalink / raw)
To: Bart Van Assche
Cc: Doug Ledford, linux-rdma, Benjamin Herrenschmidt, Chris Metcalf,
David Woodhouse, linux-arch, linux-arm-kernel, linux-kernel,
linuxppc-dev, Paul Mackerras
On Fri, Jan 20, 2017 at 01:04:03PM -0800, Bart Van Assche wrote:
> Now that all set_dma_ops() implementations are identical (ignoring
> BUG_ON() statements), remove the architecture specific definitions
> and add a definition in <linux/dma-mapping.h>.
>
> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Chris Metcalf <cmetcalf@mellanox.com>
> Cc: David Woodhouse <dwmw2@infradead.org>
> Cc: linux-arch@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Russell King <linux@armlinux.org.uk>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Thanks.
> ---
> arch/arm/include/asm/dma-mapping.h | 6 ------
> arch/powerpc/include/asm/dma-mapping.h | 5 -----
> arch/tile/include/asm/dma-mapping.h | 5 -----
> include/linux/dma-mapping.h | 5 +++++
> 4 files changed, 5 insertions(+), 16 deletions(-)
>
> diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
> index 312f4d0564d6..c7432d647e53 100644
> --- a/arch/arm/include/asm/dma-mapping.h
> +++ b/arch/arm/include/asm/dma-mapping.h
> @@ -31,12 +31,6 @@ static inline const struct dma_map_ops *get_dma_ops(struct device *dev)
> return __generic_dma_ops(dev);
> }
>
> -static inline void set_dma_ops(struct device *dev, const struct dma_map_ops *ops)
> -{
> - BUG_ON(!dev);
> - dev->dma_ops = ops;
> -}
> -
> #define HAVE_ARCH_DMA_SUPPORTED 1
> extern int dma_supported(struct device *dev, u64 mask);
>
> diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
> index 59fbd4abcbf8..8275603ba4d5 100644
> --- a/arch/powerpc/include/asm/dma-mapping.h
> +++ b/arch/powerpc/include/asm/dma-mapping.h
> @@ -91,11 +91,6 @@ static inline const struct dma_map_ops *get_dma_ops(struct device *dev)
> return dev->dma_ops;
> }
>
> -static inline void set_dma_ops(struct device *dev, const struct dma_map_ops *ops)
> -{
> - dev->dma_ops = ops;
> -}
> -
> /*
> * get_dma_offset()
> *
> diff --git a/arch/tile/include/asm/dma-mapping.h b/arch/tile/include/asm/dma-mapping.h
> index c0620697eaad..2562995a6ac9 100644
> --- a/arch/tile/include/asm/dma-mapping.h
> +++ b/arch/tile/include/asm/dma-mapping.h
> @@ -59,11 +59,6 @@ static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr)
>
> static inline void dma_mark_clean(void *addr, size_t size) {}
>
> -static inline void set_dma_ops(struct device *dev, const struct dma_map_ops *ops)
> -{
> - dev->dma_ops = ops;
> -}
> -
> static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
> {
> if (!dev->dma_mask)
> diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
> index f1da68b82c63..e97f23e8b2d9 100644
> --- a/include/linux/dma-mapping.h
> +++ b/include/linux/dma-mapping.h
> @@ -164,6 +164,11 @@ int dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma,
>
> #ifdef CONFIG_HAS_DMA
> #include <asm/dma-mapping.h>
> +static inline void set_dma_ops(struct device *dev,
> + const struct dma_map_ops *dma_ops)
> +{
> + dev->dma_ops = dma_ops;
> +}
> #else
> /*
> * Define the dma api to allow compilation but not linking of
> --
> 2.11.0
>
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-30 13:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20170120210437.26389-1-bart.vanassche@sandisk.com>
2017-01-20 21:04 ` [PATCH v3 03/37] treewide: Consolidate set_dma_ops() implementations Bart Van Assche
2017-01-30 13:58 ` Russell King - ARM Linux
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).