* [PATCH] ARM: imx: mark imx53_suspend_sz as unused
@ 2025-02-25 20:11 Arnd Bergmann
2025-03-11 2:58 ` Shawn Guo
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2025-02-25 20:11 UTC (permalink / raw)
To: Russell King, Shawn Guo, Sascha Hauer
Cc: soc, Arnd Bergmann, Pengutronix Kernel Team, Fabio Estevam,
linux-arm-kernel, imx, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
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.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm/mach-imx/common.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h
index 13f3068e9845..45c1a2a7b35f 100644
--- a/arch/arm/mach-imx/common.h
+++ b/arch/arm/mach-imx/common.h
@@ -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
--
2.39.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ARM: imx: mark imx53_suspend_sz as unused
2025-02-25 20:11 [PATCH] ARM: imx: mark imx53_suspend_sz as unused Arnd Bergmann
@ 2025-03-11 2:58 ` Shawn Guo
0 siblings, 0 replies; 2+ messages in thread
From: Shawn Guo @ 2025-03-11 2:58 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Russell King, Shawn Guo, Sascha Hauer, soc, Arnd Bergmann,
Pengutronix Kernel Team, Fabio Estevam, linux-arm-kernel, imx,
linux-kernel
On Tue, Feb 25, 2025 at 09:11:52PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> 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.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-03-11 3:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-25 20:11 [PATCH] ARM: imx: mark imx53_suspend_sz as unused Arnd Bergmann
2025-03-11 2:58 ` Shawn Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).