Skip to contentSkip to conversation

ARM: imx: mark imx53_suspend_sz as unused

PATCH Applied Arnd Bergmann 2 participants 2 messages Feb 25, 2025 – Mar 11, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: imx: mark imx53_suspend_sz as unused

From: Arnd Bergmann <[email protected]>

Unused 'static const' variables cause a warning when building with W=1, and imx53_suspend_sz has a definition for this as an alternative when CONFIG_SUSPEND is disabled:

In file included from arch/arm/mach-imx/cpu.c:9:
arch/arm/mach-imx/common.h:101:18: error: 'imx53_suspend_sz' defined but not used [-Werror=unused-const-variable=]

It's still referenced though, so mark it as __maybe_unused, so the one user can address the dummy copy and other files that include the header don't produce a warning.

---
 arch/arm/mach-imx/common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-imx/common.h +1 -1
index 13f3068e9845..45c1a2a7b35f 100644
@@ -98,7 +98,7 @@ extern const u32 imx53_suspend_sz;
 void imx6_suspend(void __iomem *ocram_vbase);
 #else
 static inline void imx53_suspend(void __iomem *ocram_vbase) {}
-static const u32 imx53_suspend_sz;
+static __maybe_unused const u32 imx53_suspend_sz;
 static inline void imx6_suspend(void __iomem *ocram_vbase) {}
 #endif
 
Signature · 1 line
2.39.5
Applied
#1 lore raw
Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Unused 'static const' variables cause a warning when building with W=1, and imx53_suspend_sz has a definition for this as an alternative when CONFIG_SUSPEND is disabled:

Quoted 8 lines

In file included from arch/arm/mach-imx/cpu.c:9:
arch/arm/mach-imx/common.h:101:18: error: 'imx53_suspend_sz' defined but not used [-Werror=unused-const-variable=]

It's still referenced though, so mark it as __maybe_unused, so the one user can address the dummy copy and other files that include the header don't produce a warning.

Applied, thanks!