[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230516154605.517690-2-arnd@kernel.org>
Date: Tue, 16 May 2023 17:45:50 +0200
From: Arnd Bergmann <arnd@...nel.org>
To: Russell King <linux@...linux.org.uk>
Cc: Arnd Bergmann <arnd@...db.de>,
Steven Rostedt <rostedt@...dmis.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Oleg Nesterov <oleg@...hat.com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Pavel Machek <pavel@....cz>,
Linus Walleij <linus.walleij@...aro.org>,
Ard Biesheuvel <ardb@...nel.org>,
Kees Cook <keescook@...omium.org>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org, linux-pm@...r.kernel.org
Subject: [PATCH 01/16] ARM: dma-mapping: hide unused dma_contiguous_early_fixup function
From: Arnd Bergmann <arnd@...db.de>
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.
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
arch/arm/mm/dma-mapping.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index b4a33358d2e9..bc4ed5ce3e00 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -258,12 +258,14 @@ static struct dma_contig_early_reserve dma_mmu_remap[MAX_CMA_AREAS] __initdata;
static int dma_mmu_remap_num __initdata;
+#ifdef CONFIG_DMA_CMA
void __init dma_contiguous_early_fixup(phys_addr_t base, unsigned long size)
{
dma_mmu_remap[dma_mmu_remap_num].base = base;
dma_mmu_remap[dma_mmu_remap_num].size = size;
dma_mmu_remap_num++;
}
+#endif
void __init dma_contiguous_remap(void)
{
--
2.39.2
Powered by blists - more mailing lists