[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240403080702.3509288-15-arnd@kernel.org>
Date: Wed, 3 Apr 2024 10:06:32 +0200
From: Arnd Bergmann <arnd@...nel.org>
To: linux-kernel@...r.kernel.org,
Christoph Hellwig <hch@....de>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Arnd Bergmann <arnd@...db.de>,
Kyungmin Park <kyungmin.park@...sung.com>,
Michal Nazarewicz <mina86@...a86.com>
Cc: Robin Murphy <robin.murphy@....com>,
Yajun Deng <yajun.deng@...ux.dev>,
Binglei Wang <l3b2w1@...il.com>,
Anshuman Khandual <anshuman.khandual@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Zhenhua Huang <quic_zhenhuah@...cinc.com>,
iommu@...ts.linux.dev
Subject: [PATCH 14/34] dma/congiguous: avoid warning about unused size_bytes
From: Arnd Bergmann <arnd@...db.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@...db.de>
---
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.2
Powered by blists - more mailing lists