Skip to content

Commit 86dc11c

Browse files
andy-shevrafaeljw
authored andcommitted
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>
1 parent 934eee0 commit 86dc11c

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

drivers/acpi/proc.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0
22
#include <linux/proc_fs.h>
33
#include <linux/seq_file.h>
4+
#include <linux/string_choices.h>
45
#include <linux/suspend.h>
56
#include <linux/bcd.h>
67
#include <linux/acpi.h>
@@ -38,8 +39,7 @@ acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset)
3839
if (!dev->physical_node_count) {
3940
seq_printf(seq, "%c%-8s\n",
4041
dev->wakeup.flags.valid ? '*' : ' ',
41-
device_may_wakeup(&dev->dev) ?
42-
"enabled" : "disabled");
42+
str_enabled_disabled(device_may_wakeup(&dev->dev)));
4343
} else {
4444
struct device *ldev;
4545
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)
5454

5555
seq_printf(seq, "%c%-8s %s:%s\n",
5656
dev->wakeup.flags.valid ? '*' : ' ',
57-
(device_may_wakeup(&dev->dev) ||
58-
device_may_wakeup(ldev)) ?
59-
"enabled" : "disabled",
57+
str_enabled_disabled(device_may_wakeup(ldev) ||
58+
device_may_wakeup(&dev->dev)),
6059
ldev->bus ? ldev->bus->name :
6160
"no-bus", dev_name(ldev));
6261
put_device(ldev);

0 commit comments

Comments
 (0)