]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ACPI: battery: Drop redundant check from acpi_battery_notify()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 6 Feb 2026 21:28:12 +0000 (22:28 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 11 Feb 2026 20:21:58 +0000 (21:21 +0100)
The battery pointer check against NULL in acpi_battery_notify() is
redundant because the value of that pointer is the one passed to
acpi_dev_install_notify_handler() in acpi_battery_probe() as the
last argument which is not NULL.

Drop the redundant check.

No intentional functional impact.

Closes: https://lore.kernel.org/linux-acpi/aYXvS1h3Bxf_5sCj@stanley.mountain/
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/5981321.DvuYhMxLoT@rafael.j.wysocki
drivers/acpi/battery.c

index 3bbddd6f622c8e1ec726d12fb75d5556838f3e38..a094763113bcd5bf6d69aa24a63259a2cac337f2 100644 (file)
@@ -1066,9 +1066,6 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data)
        struct acpi_device *device = battery->device;
        struct power_supply *old;
 
-       if (!battery)
-               return;
-
        guard(mutex)(&battery->update_lock);
 
        old = battery->bat;