arm64: fix warnings without CONFIG_IOMMU_DMA
authorChristoph Hellwig <[email protected]>
Tue, 30 Oct 2018 07:41:29 +0000 (09:41 +0200)
committerChristoph Hellwig <[email protected]>
Fri, 2 Nov 2018 18:27:22 +0000 (19:27 +0100)
__swiotlb_get_sgtable_page and __swiotlb_mmap_pfn are not only misnamed
but also only used if CONFIG_IOMMU_DMA is set.  Just add a simple ifdef
for now, given that we plan to remove them entirely for the next merge
window.

Reported-by: Florian Fainelli <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Tested-by: Will Deacon <[email protected]>
Acked-by: Catalin Marinas <[email protected]>
arch/arm64/mm/dma-mapping.c

index 3a703e5d4e3237f9844d09e871ef1eaa62b781cc..a3ac262848451ae49535c37a6997a211b0f5e914 100644 (file)
@@ -160,6 +160,7 @@ void arch_sync_dma_for_cpu(struct device *dev, phys_addr_t paddr,
        __dma_unmap_area(phys_to_virt(paddr), size, dir);
 }
 
+#ifdef CONFIG_IOMMU_DMA
 static int __swiotlb_get_sgtable_page(struct sg_table *sgt,
                                      struct page *page, size_t size)
 {
@@ -188,6 +189,7 @@ static int __swiotlb_mmap_pfn(struct vm_area_struct *vma,
 
        return ret;
 }
+#endif /* CONFIG_IOMMU_DMA */
 
 static int __init atomic_pool_init(void)
 {