Skip to contentSkip to conversation

firmware: arm: psci: Fix unused variable warning

PATCH Applied Sudeep Holla 1 participant 2 messages Nov 12 – Nov 19

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 firmware: arm: psci: Fix unused variable warning

Clang 23 and above complains with the below warning while building psci.c:

 | drivers/firmware/arm/psci/psci.c:81:13: warning: variable
 |     'psci_system_off2_hibernate_supported' set but not used [-Wunused-but-set-global]
 |     81 | static bool psci_system_off2_hibernate_supported;
 |        |             ^
 |  1 warning generated.

Fix it by applying the __maybe_unused annotation to the variable declaration.

---
 drivers/firmware/arm/psci/psci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/arm/psci/psci.c +1 -1
index e73bae6cb23a..01b1ea6a1c65 100644
@@ -78,7 +78,7 @@ struct psci_0_1_function_ids get_psci_0_1_function_ids(void)
 
 static u32 psci_cpu_suspend_feature;
 static bool psci_system_reset2_supported;
-static bool psci_system_off2_hibernate_supported;
+static bool __maybe_unused psci_system_off2_hibernate_supported;
 
 static inline bool psci_has_ext_power_state(void)
 {

base-commit: 49c49ca0c4d02848a9576f72c4741c38c5ba09de

Signature · 1 line
2.43.0
author Applied
#1 lore raw
Quoted 9 lines · Sudeep Holla

Clang 23 and above complains with the below warning while building psci.c:

 | drivers/firmware/arm/psci/psci.c:81:13: warning: variable
 |     'psci_system_off2_hibernate_supported' set but not used [-Wunused-but-set-global]
 |     81 | static bool psci_system_off2_hibernate_supported;
 |        |             ^
 |  1 warning generated.

[...]

Applied to sudeep.holla/linux (for-linux-next), thanks!

[1/1] firmware: arm: psci: Fix unused variable warning

      https://git.kernel.org/sudeep.holla/c/9cc33d1ca1dc
Signature · 2 lines
Regards,
Sudeep