Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andy Shevchenko and committed by
Rafael J. Wysocki
86dc11cd 934eee0c

+4 -5
+4 -5
drivers/acpi/proc.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include <linux/proc_fs.h> 3 3 #include <linux/seq_file.h> 4 + #include <linux/string_choices.h> 4 5 #include <linux/suspend.h> 5 6 #include <linux/bcd.h> 6 7 #include <linux/acpi.h> ··· 39 38 if (!dev->physical_node_count) { 40 39 seq_printf(seq, "%c%-8s\n", 41 40 dev->wakeup.flags.valid ? '*' : ' ', 42 - device_may_wakeup(&dev->dev) ? 43 - "enabled" : "disabled"); 41 + str_enabled_disabled(device_may_wakeup(&dev->dev))); 44 42 } else { 45 43 struct device *ldev; 46 44 list_for_each_entry(entry, &dev->physical_node_list, ··· 54 54 55 55 seq_printf(seq, "%c%-8s %s:%s\n", 56 56 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)), 60 59 ldev->bus ? ldev->bus->name : 61 60 "no-bus", dev_name(ldev)); 62 61 put_device(ldev);