diff options
author | Christoph Hellwig <hch@lst.de> | 2018-03-23 13:49:30 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2018-03-23 15:15:38 -0400 |
commit | 0803e6051c1562e1525c3e044313390bf8b35c2b (patch) | |
tree | 3dfff08cbfc30eac2e23d072db590a394a952269 | |
parent | 16e73adbca76fd18733278cb688b0ddb4cad162c (diff) |
swiotlb: Make swiotlb_{alloc,free}_buffer depend on CONFIG_DMA_DIRECT_OPS
Otherwise this causes unused symbol warnings for configs that build
swiotlb.c only for use by xen-swiotlb.c and that don't otherwise select
CONFIG_DMA_DIRECT_OPS, which is possible on arm.
Fixes: 16e73adbca76 ("dma/swiotlb: Remove swiotlb_{alloc,free}_coherent()")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: iommu@lists.linux-foundation.org
Cc: konrad.wilk@oracle.com
Link: https://lkml.kernel.org/r/20180323174930.17767-1-hch@lst.de
-rw-r--r-- | lib/swiotlb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/swiotlb.c b/lib/swiotlb.c index 15954b86f09e..47aeb04c1997 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c | |||
@@ -692,6 +692,7 @@ void swiotlb_tbl_sync_single(struct device *hwdev, phys_addr_t tlb_addr, | |||
692 | } | 692 | } |
693 | } | 693 | } |
694 | 694 | ||
695 | #ifdef CONFIG_DMA_DIRECT_OPS | ||
695 | static inline bool dma_coherent_ok(struct device *dev, dma_addr_t addr, | 696 | static inline bool dma_coherent_ok(struct device *dev, dma_addr_t addr, |
696 | size_t size) | 697 | size_t size) |
697 | { | 698 | { |
@@ -763,6 +764,7 @@ static bool swiotlb_free_buffer(struct device *dev, size_t size, | |||
763 | DMA_ATTR_SKIP_CPU_SYNC); | 764 | DMA_ATTR_SKIP_CPU_SYNC); |
764 | return true; | 765 | return true; |
765 | } | 766 | } |
767 | #endif | ||
766 | 768 | ||
767 | static void | 769 | static void |
768 | swiotlb_full(struct device *dev, size_t size, enum dma_data_direction dir, | 770 | swiotlb_full(struct device *dev, size_t size, enum dma_data_direction dir, |