Skip to content

Commit 3745de7

Browse files
ij-intelrafaeljw
authored andcommitted
ACPI: battery: Remove redundant NULL initalizations
A local 'battery' variable is initialized to NULL on two occassions where it is unconditionally rewritten later. Remove the unnecessary initializations. Signed-off-by: Ilpo Järvinen <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 142acc4 commit 3745de7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/acpi/battery.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ static int acpi_battery_update_retry(struct acpi_battery *battery)
12071207
static int acpi_battery_add(struct acpi_device *device)
12081208
{
12091209
int result = 0;
1210-
struct acpi_battery *battery = NULL;
1210+
struct acpi_battery *battery;
12111211

12121212
if (!device)
12131213
return -EINVAL;
@@ -1260,7 +1260,7 @@ static int acpi_battery_add(struct acpi_device *device)
12601260

12611261
static void acpi_battery_remove(struct acpi_device *device)
12621262
{
1263-
struct acpi_battery *battery = NULL;
1263+
struct acpi_battery *battery;
12641264

12651265
if (!device || !acpi_driver_data(device))
12661266
return;

0 commit comments

Comments
 (0)