iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] swiotlb: swiotlb_{alloc, free}_buffer should depend on CONFIG_DMA_DIRECT_OPS
@ 2018-03-23 17:49 Christoph Hellwig
       [not found] ` <20180323174930.17767-1-hch-jcswGhMUV9g@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2018-03-23 17:49 UTC (permalink / raw)
  To: tglx-hfZtesqFncYOwBW4kG4KsQ, mingo-X9Un+BFzKDI
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA

Otherwise we might get unused symbol warnings for configs that built
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-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
 lib/swiotlb.c | 2 ++
 1 file changed, 2 insertions(+)

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,
 	}
 }
 
+#ifdef CONFIG_DMA_DIRECT_OPS
 static inline bool dma_coherent_ok(struct device *dev, dma_addr_t addr,
 		size_t size)
 {
@@ -763,6 +764,7 @@ static bool swiotlb_free_buffer(struct device *dev, size_t size,
 				 DMA_ATTR_SKIP_CPU_SYNC);
 	return true;
 }
+#endif
 
 static void
 swiotlb_full(struct device *dev, size_t size, enum dma_data_direction dir,
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-26 13:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-23 17:49 [PATCH] swiotlb: swiotlb_{alloc, free}_buffer should depend on CONFIG_DMA_DIRECT_OPS Christoph Hellwig
     [not found] ` <20180323174930.17767-1-hch-jcswGhMUV9g@public.gmane.org>
2018-03-23 18:57   ` [PATCH] swiotlb: swiotlb_{alloc,free}_buffer " Konrad Rzeszutek Wilk
2018-03-23 19:41     ` Thomas Gleixner
     [not found]     ` <20180323185707.GD25533-he5eyhs8q0BAdwtm4QZOy9BPR1lH4CV8@public.gmane.org>
2018-03-24 17:03       ` Christoph Hellwig
     [not found]         ` <20180324170351.GA511-jcswGhMUV9g@public.gmane.org>
2018-03-24 20:05           ` Konrad Rzeszutek Wilk
     [not found]             ` <20180324200545.GC23658-he5eyhs8q0BAdwtm4QZOy9BPR1lH4CV8@public.gmane.org>
2018-03-26 13:42               ` Christoph Hellwig

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).