Browse Source

ACPI: Fix unused variable warning in sbs.c

When CONFIG_ACPI_SYSFS_POWER=n and CONFIG_ACPI_PROCFS_POWER=n, then
we're warned by the following warning:

drivers/acpi/sbs.c: In function `acpi_battery_remove':
drivers/acpi/sbs.c:825: warning: unused variable `battery'

Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
Rakib Mullick 15 years ago
parent
commit
c19bdb6126
1 changed files with 3 additions and 0 deletions
  1. 3 0
      drivers/acpi/sbs.c

+ 3 - 0
drivers/acpi/sbs.c

@@ -822,7 +822,10 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id)
 
 
 static void acpi_battery_remove(struct acpi_sbs *sbs, int id)
 static void acpi_battery_remove(struct acpi_sbs *sbs, int id)
 {
 {
+#if defined(CONFIG_ACPI_SYSFS_POWER) || defined(CONFIG_ACPI_PROCFS_POWER)
 	struct acpi_battery *battery = &sbs->battery[id];
 	struct acpi_battery *battery = &sbs->battery[id];
+#endif
+
 #ifdef CONFIG_ACPI_SYSFS_POWER
 #ifdef CONFIG_ACPI_SYSFS_POWER
 	if (battery->bat.dev) {
 	if (battery->bat.dev) {
 		if (battery->have_sysfs_alarm)
 		if (battery->have_sysfs_alarm)