diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2025-06-12 23:11:28 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-06-26 21:08:13 +0200 |
commit | 86dc11cd6f5cb19ea9d33610216acfa786e09b1d (patch) | |
tree | 95d9c75fc53903d72fbe6e4c46436085b626a832 | |
parent | 934eee0ce35cde5ea8a570de94cf5903cb44518d (diff) |
ACPI: proc: Use str_enabled_disabled() helper
Replace ternary (condition ? "enabled" : "disabled") with
str_enabled_disabled() from string_choices.h to improve readability,
maintain uniform string usage, and reduce binary size through linker
deduplication.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20250612201321.3536493-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/acpi/proc.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/acpi/proc.c b/drivers/acpi/proc.c index 8ae85b06c422..440150c67ba6 100644 --- a/drivers/acpi/proc.c +++ b/drivers/acpi/proc.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/proc_fs.h> #include <linux/seq_file.h> +#include <linux/string_choices.h> #include <linux/suspend.h> #include <linux/bcd.h> #include <linux/acpi.h> @@ -38,8 +39,7 @@ acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset) if (!dev->physical_node_count) { seq_printf(seq, "%c%-8s\n", dev->wakeup.flags.valid ? '*' : ' ', - device_may_wakeup(&dev->dev) ? - "enabled" : "disabled"); + str_enabled_disabled(device_may_wakeup(&dev->dev))); } else { struct device *ldev; list_for_each_entry(entry, &dev->physical_node_list, @@ -54,9 +54,8 @@ acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset) seq_printf(seq, "%c%-8s %s:%s\n", dev->wakeup.flags.valid ? '*' : ' ', - (device_may_wakeup(&dev->dev) || - device_may_wakeup(ldev)) ? - "enabled" : "disabled", + str_enabled_disabled(device_may_wakeup(ldev) || + device_may_wakeup(&dev->dev)), ldev->bus ? ldev->bus->name : "no-bus", dev_name(ldev)); put_device(ldev); |