Skip to content

Commit a9f8f2b

Browse files
arndbRussell King (Oracle)
authored andcommitted
ARM: 9301/1: dma-mapping: hide unused dma_contiguous_early_fixup function
The dma_contiguous_early_fixup() function is a global __weak stub with an arm specific override, but the declaration is in an #ifdef. If CONFIG_DMA_CMA is disabled, there is no caller and no prototype, which adds a warning for the definition: arm/mm/dma-mapping.c:261:13: error: no previous prototype for 'dma_contiguous_early_fixup' [-Werror=missing-prototypes] Enclose the definition in the same #ifdef as the prototype to avoid that and save a few bytes of .init.text. Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
1 parent 7611b33 commit a9f8f2b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/arm/mm/dma-mapping.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,14 @@ static struct dma_contig_early_reserve dma_mmu_remap[MAX_CMA_AREAS] __initdata;
258258

259259
static int dma_mmu_remap_num __initdata;
260260

261+
#ifdef CONFIG_DMA_CMA
261262
void __init dma_contiguous_early_fixup(phys_addr_t base, unsigned long size)
262263
{
263264
dma_mmu_remap[dma_mmu_remap_num].base = base;
264265
dma_mmu_remap[dma_mmu_remap_num].size = size;
265266
dma_mmu_remap_num++;
266267
}
268+
#endif
267269

268270
void __init dma_contiguous_remap(void)
269271
{

0 commit comments

Comments
 (0)