Skip to content

Commit b437a0d

Browse files
committed
dma/contiguous: avoid warning about unused size_bytes
commit d7b98ae Author: Arnd Bergmann <[email protected]> Date: Wed Apr 9 17:15:42 2025 +0200 dma/contiguous: avoid warning about unused size_bytes 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=] Change this to a macro to avoid the warning. Fixes: c64be2b ("drivers: add Contiguous Memory Allocator") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Marek Szyprowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] (cherry picked from commit d7b98ae) Signed-off-by: Jerry Snitselaar <[email protected]> Upstream-Status: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git JIRA: https://issues.redhat.com/browse/RHEL-89891
1 parent 93a10b8 commit b437a0d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

kernel/dma/contiguous.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ struct cma *dma_contiguous_default_area;
6464
* Users, who want to set the size of global CMA area for their system
6565
* should use cma= kernel parameter.
6666
*/
67-
static const phys_addr_t size_bytes __initconst =
68-
(phys_addr_t)CMA_SIZE_MBYTES * SZ_1M;
67+
#define size_bytes ((phys_addr_t)CMA_SIZE_MBYTES * SZ_1M)
6968
static phys_addr_t size_cmdline __initdata = -1;
7069
static phys_addr_t base_cmdline __initdata;
7170
static phys_addr_t limit_cmdline __initdata;

0 commit comments

Comments
 (0)