<dma.h> will take care to define dma_alloc with DMA_ALIGNMENT as alignment. As 32 is the default and may not be applicable to the used processor, we define DMA_ALIGNMENT and drop the now duplicate code. Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> --- arch/mips/include/asm/dma.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/mips/include/asm/dma.h b/arch/mips/include/asm/dma.h index d7570cce7109..5c5b6d5b3a58 100644 --- a/arch/mips/include/asm/dma.h +++ b/arch/mips/include/asm/dma.h @@ -14,13 +14,8 @@ #include <asm/io.h> #include <asm/types.h> -#define dma_alloc dma_alloc -static inline void *dma_alloc(size_t size) -{ - unsigned long max_linesz = max(current_cpu_data.dcache.linesz, - current_cpu_data.scache.linesz); - return xmemalign(max_linesz, ALIGN(size, max_linesz)); -} +#define DMA_ALIGNMENT \ + max(current_cpu_data.dcache.linesz, current_cpu_data.scache.linesz) #define dma_alloc_coherent dma_alloc_coherent static inline void *dma_alloc_coherent(size_t size, dma_addr_t *dma_handle) -- 2.39.2