Skip to content

Commit 616990c

Browse files
mwilczyrafaeljw
authored andcommitted
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 <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Michal Wilczynski <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent bc4c975 commit 616990c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/acpi/ac.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/delay.h>
1818
#include <linux/platform_device.h>
1919
#include <linux/power_supply.h>
20+
#include <linux/string_choices.h>
2021
#include <linux/acpi.h>
2122
#include <acpi/battery.h>
2223

@@ -243,8 +244,8 @@ static int acpi_ac_add(struct acpi_device *device)
243244
goto err_release_ac;
244245
}
245246

246-
pr_info("%s [%s] (%s)\n", acpi_device_name(device),
247-
acpi_device_bid(device), ac->state ? "on-line" : "off-line");
247+
pr_info("%s [%s] (%s-line)\n", acpi_device_name(device),
248+
acpi_device_bid(device), str_on_off(ac->state));
248249

249250
ac->battery_nb.notifier_call = acpi_ac_battery_notify;
250251
register_acpi_notifier(&ac->battery_nb);

0 commit comments

Comments
 (0)