diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2026-06-01 18:59:06 +0200 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2026-06-01 19:17:49 +0200 |
| commit | a2a3659829b1062fa86eeecb7cb575fd3ba0338e (patch) | |
| tree | 097de4e3348e245168d9468ff27f59a505642be2 | |
| parent | c0e0b84d9e6fd74f9390aa4014dd265947f1c0d7 (diff) | |
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
| -rw-r--r-- | drivers/acpi/button.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 21a10da8b60b..ae97c83bae2c 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -201,7 +201,7 @@ static int acpi_lid_evaluate_state(acpi_handle lid_handle) if (ACPI_FAILURE(status)) return -ENODEV; - return lid_state ? 1 : 0; + return !!lid_state; } static int acpi_lid_notify_state(struct acpi_button *button, bool state) |
