Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

apm-emulation: hide an unused variable

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")
Acked-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20250409122314.2848028-9-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Arnd Bergmann and committed by
Greg Kroah-Hartman
c2c707bd 7ae52a3d

+2 -3
+2 -3
drivers/char/apm-emulation.c
··· 141 141 142 142 static DEFINE_MUTEX(state_lock); 143 143 144 - static const char driver_version[] = "1.13"; /* no spaces */ 145 - 146 - 147 144 148 145 /* 149 146 * Compatibility cruft until the IPAQ people move over to the new ··· 432 435 */ 433 436 static int proc_apm_show(struct seq_file *m, void *v) 434 437 { 438 + static const char driver_version[] = "1.13"; /* no spaces */ 439 + 435 440 struct apm_power_info info; 436 441 char *units; 437 442