summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Wilczynski <michal.wilczynski@intel.com>2023-10-11 11:33:30 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-10-13 19:51:54 +0200
commit616990c92e40e4721beb66c2f855915fc1f32aba (patch)
tree4da61d51ae979b416bb58c7c78428f8fb9cd13ed
parentbc4c9757e324334b84e3ecd52d752cbce54208ab (diff)
ACPI: AC: Use string_choices API instead of ternary operator
Use modern string_choices API instead of manually determining the output using ternary operator. Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Michal Wilczynski <michal.wilczynski@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/ac.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 83d45c681121..f809f6889b4a 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -17,6 +17,7 @@
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
+#include <linux/string_choices.h>
#include <linux/acpi.h>
#include <acpi/battery.h>
@@ -243,8 +244,8 @@ static int acpi_ac_add(struct acpi_device *device)
goto err_release_ac;
}
- pr_info("%s [%s] (%s)\n", acpi_device_name(device),
- acpi_device_bid(device), ac->state ? "on-line" : "off-line");
+ pr_info("%s [%s] (%s-line)\n", acpi_device_name(device),
+ acpi_device_bid(device), str_on_off(ac->state));
ac->battery_nb.notifier_call = acpi_ac_battery_notify;
register_acpi_notifier(&ac->battery_nb);