dma-mapping: move arch_dma_set_mask() declaration to header
authorArnd Bergmann <arnd@arndb.de>
Thu, 27 Jul 2023 12:25:42 +0000 (14:25 +0200)
committerChristoph Hellwig <hch@lst.de>
Mon, 31 Jul 2023 15:54:28 +0000 (17:54 +0200)
This function has a __weak definition and an override that is only used on
freescale powerpc chips. The powerpc definition however does not see the
declaration that is in a .c file:

arch/powerpc/kernel/dma-mask.c:7:6: error: no previous prototype for 'arch_dma_set_mask' [-Werror=missing-prototypes]

Move it into the linux/dma-map-ops.h header where the other arch_dma_* functions
are declared.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
arch/powerpc/kernel/dma-mask.c
include/linux/dma-map-ops.h
kernel/dma/mapping.c

index ffbbbc432612674feb475d58e76c247290e4e436..5b07ca7b73aacbf09c6eea690ccc43dcd02532f4 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 
 #include <linux/dma-mapping.h>
+#include <linux/dma-map-ops.h>
 #include <linux/export.h>
 #include <asm/machdep.h>
 
index 9bf19b5bf7559fea9ba0a672ed62507eecb7201f..bb5e06fd359d592cb28bfbb28cadfd11cbdf1ad3 100644 (file)
@@ -343,6 +343,12 @@ void *arch_dma_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle,
 void arch_dma_free(struct device *dev, size_t size, void *cpu_addr,
                dma_addr_t dma_addr, unsigned long attrs);
 
+#ifdef CONFIG_ARCH_HAS_DMA_SET_MASK
+void arch_dma_set_mask(struct device *dev, u64 mask);
+#else
+#define arch_dma_set_mask(dev, mask)   do { } while (0)
+#endif
+
 #ifdef CONFIG_MMU
 /*
  * Page protection so that devices that can't snoop CPU caches can use the
index 9a4db5cce600411c240afea0c0e223c25f51f19c..e323ca48f7f2a4e8bbcb66065b7ff35876902fab 100644 (file)
@@ -760,12 +760,6 @@ bool dma_pci_p2pdma_supported(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(dma_pci_p2pdma_supported);
 
-#ifdef CONFIG_ARCH_HAS_DMA_SET_MASK
-void arch_dma_set_mask(struct device *dev, u64 mask);
-#else
-#define arch_dma_set_mask(dev, mask)   do { } while (0)
-#endif
-
 int dma_set_mask(struct device *dev, u64 mask)
 {
        /*