ACPI: button: Eliminate redundant conditional statement

Simplify do_update initialization in acpi_lid_notify_state() by
assigning the value of the condition it depends on directly to it.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/10868292.nUPlyArG6x@rafael.j.wysocki
This commit is contained in:
Rafael J. Wysocki
2026-06-01 19:00:47 +02:00
parent 06bc0064ad
commit d9fa7b95d1

View File

@@ -217,12 +217,8 @@ static void acpi_lid_notify_state(struct acpi_button *button, bool state)
* So "last_time" is only updated after a timeout or an actual
* switch.
*/
if (lid_init_state != ACPI_BUTTON_LID_INIT_IGNORE ||
button->last_state != state)
do_update = true;
else
do_update = false;
do_update = lid_init_state != ACPI_BUTTON_LID_INIT_IGNORE ||
button->last_state != state;
next_report = ktime_add(button->last_time,
ms_to_ktime(lid_report_interval));
if (button->last_state == state &&