Skip to content

Commit a2a3659

Browse files
committed
ACPI: button: Eliminate ternary operator from acpi_lid_evaluate_state()
The ternary operator in acpi_lid_evaluate_state() is not actually needed because the same result can be achieved by applying the !! operator to the lid_state value, so update the code accordingly. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3055906.e9J7NaK4W3@rafael.j.wysocki
1 parent c0e0b84 commit a2a3659

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/acpi/button.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ static int acpi_lid_evaluate_state(acpi_handle lid_handle)
201201
if (ACPI_FAILURE(status))
202202
return -ENODEV;
203203

204-
return lid_state ? 1 : 0;
204+
return !!lid_state;
205205
}
206206

207207
static int acpi_lid_notify_state(struct acpi_button *button, bool state)

0 commit comments

Comments
 (0)