Skip to content

Commit 3d6f126

Browse files
arndbChristoph Hellwig
authored andcommitted
dma-mapping: move arch_dma_set_mask() declaration to header
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>
1 parent 42e584a commit 3d6f126

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

arch/powerpc/kernel/dma-mask.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0
22

33
#include <linux/dma-mapping.h>
4+
#include <linux/dma-map-ops.h>
45
#include <linux/export.h>
56
#include <asm/machdep.h>
67

include/linux/dma-map-ops.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,12 @@ void *arch_dma_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle,
343343
void arch_dma_free(struct device *dev, size_t size, void *cpu_addr,
344344
dma_addr_t dma_addr, unsigned long attrs);
345345

346+
#ifdef CONFIG_ARCH_HAS_DMA_SET_MASK
347+
void arch_dma_set_mask(struct device *dev, u64 mask);
348+
#else
349+
#define arch_dma_set_mask(dev, mask) do { } while (0)
350+
#endif
351+
346352
#ifdef CONFIG_MMU
347353
/*
348354
* Page protection so that devices that can't snoop CPU caches can use the

kernel/dma/mapping.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -760,12 +760,6 @@ bool dma_pci_p2pdma_supported(struct device *dev)
760760
}
761761
EXPORT_SYMBOL_GPL(dma_pci_p2pdma_supported);
762762

763-
#ifdef CONFIG_ARCH_HAS_DMA_SET_MASK
764-
void arch_dma_set_mask(struct device *dev, u64 mask);
765-
#else
766-
#define arch_dma_set_mask(dev, mask) do { } while (0)
767-
#endif
768-
769763
int dma_set_mask(struct device *dev, u64 mask)
770764
{
771765
/*

0 commit comments

Comments
 (0)