Skip to content

Commit 6993ce4

Browse files
bmorkrafaeljw
authored andcommitted
ACPI: battery: Drop redundant test for failure
Merging the two adjacent conditionally built blocks makes the code a lot more readable. And as a bonus, we drop a duplicate test when CONFIG_ACPI_PROCFS_POWER is undefined. Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 50c4c4e commit 6993ce4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/acpi/battery.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,13 +1237,11 @@ static int acpi_battery_add(struct acpi_device *device)
12371237

12381238
#ifdef CONFIG_ACPI_PROCFS_POWER
12391239
result = acpi_battery_add_fs(device);
1240-
#endif
12411240
if (result) {
1242-
#ifdef CONFIG_ACPI_PROCFS_POWER
12431241
acpi_battery_remove_fs(device);
1244-
#endif
12451242
goto fail;
12461243
}
1244+
#endif
12471245

12481246
printk(KERN_INFO PREFIX "%s Slot [%s] (battery %s)\n",
12491247
ACPI_BATTERY_DEVICE_NAME, acpi_device_bid(device),

0 commit comments

Comments
 (0)