Skip to content

Commit d9fa7b9

Browse files
committed
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
1 parent 06bc006 commit d9fa7b9

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

drivers/acpi/button.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,8 @@ static void acpi_lid_notify_state(struct acpi_button *button, bool state)
217217
* So "last_time" is only updated after a timeout or an actual
218218
* switch.
219219
*/
220-
if (lid_init_state != ACPI_BUTTON_LID_INIT_IGNORE ||
221-
button->last_state != state)
222-
do_update = true;
223-
else
224-
do_update = false;
225-
220+
do_update = lid_init_state != ACPI_BUTTON_LID_INIT_IGNORE ||
221+
button->last_state != state;
226222
next_report = ktime_add(button->last_time,
227223
ms_to_ktime(lid_report_interval));
228224
if (button->last_state == state &&

0 commit comments

Comments
 (0)