public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [v2] dma/congiuous: avoid warning about unused size_bytes
@ 2025-02-25 14:55 Arnd Bergmann
  0 siblings, 0 replies; only message in thread
From: Arnd Bergmann @ 2025-02-25 14:55 UTC (permalink / raw)
  To: Christoph Hellwig, Marek Szyprowski
  Cc: Arnd Bergmann, Robin Murphy, Michal Nazarewicz, Kyungmin Park,
	iommu, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

When building with W=1, this variable is unused for configs with
CONFIG_CMA_SIZE_SEL_PERCENTAGE=y:

kernel/dma/contiguous.c:67:26: error: 'size_bytes' defined but not used [-Werror=unused-const-variable=]

Mark it as __maybe_unused to avoid the warning without adding more
ifdef checks to this file.

Fixes: c64be2bb1c6e ("drivers: add Contiguous Memory Allocator")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
v2: fix spelling mistake.
---
 kernel/dma/contiguous.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/dma/contiguous.c b/kernel/dma/contiguous.c
index 055da410ac71..c53f4f633f7f 100644
--- a/kernel/dma/contiguous.c
+++ b/kernel/dma/contiguous.c
@@ -64,7 +64,7 @@ struct cma *dma_contiguous_default_area;
  * Users, who want to set the size of global CMA area for their system
  * should use cma= kernel parameter.
  */
-static const phys_addr_t size_bytes __initconst =
+static const phys_addr_t size_bytes __initconst __maybe_unused =
 	(phys_addr_t)CMA_SIZE_MBYTES * SZ_1M;
 static phys_addr_t  size_cmdline __initdata = -1;
 static phys_addr_t base_cmdline __initdata;
-- 
2.39.5


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-02-25 14:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-25 14:55 [PATCH] [v2] dma/congiuous: avoid warning about unused size_bytes Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox