Skip to contentSkip to conversation

apm-emulation: hide an unused variable

PATCH RESEND New Arnd Bergmann 1 participant 1 message Feb 25, 2025

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

PATCH RESEND 1/1 apm-emulation: hide an unused variable

From: Arnd Bergmann <[email protected]>

The driver_version variable is only used inside of an #ifdef block, which leads to a W=1 warning:

drivers/char/apm-emulation.c:144:19: error: 'driver_version' defined but not used [-Werror=unused-const-variable=]

Move this into the function using it.

Fixes 7726942fb15e ("[APM] Add shared version of APM emulation")

---
Found while looking through my patch backlog, still applies

---
 drivers/char/apm-emulation.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/char/apm-emulation.c +2 -3
index e795390b070f..53ce352f7197 100644
@@ -141,9 +141,6 @@ static struct apm_queue kapmd_queue;
 
 static DEFINE_MUTEX(state_lock);
 
-static const char driver_version[] = "1.13";	/* no spaces */
-
-
 
 /*
  * Compatibility cruft until the IPAQ people move over to the new
@@ -435,6 +432,8 @@ static struct miscdevice apm_device = {
  */
 static int proc_apm_show(struct seq_file *m, void *v)
 {
+	static const char driver_version[] = "1.13";	/* no spaces */
+
 	struct apm_power_info info;
 	char *units;
 
Signature · 1 line
2.39.5