Skip to content

Commit 2dc1b0d

Browse files
tobluxrafaeljw
authored andcommitted
thermal: sysfs: Use str_enabled_disabled() helper in mode_show()
Replace hard-coded strings with the str_enabled_disabled() helper. This unifies the output and helps the linker with deduplication, which may result in a smaller binary. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> [ rjw: Subject and changelog tweaks ] Link: https://patch.msgid.link/20260311164212.405981-3-thorsten.blum@linux.dev Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 5ddd020 commit 2dc1b0d

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

drivers/thermal/thermal_sysfs.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/err.h>
1919
#include <linux/slab.h>
2020
#include <linux/string.h>
21+
#include <linux/string_choices.h>
2122
#include <linux/jiffies.h>
2223

2324
#include "thermal_core.h"
@@ -56,10 +57,8 @@ mode_show(struct device *dev, struct device_attribute *attr, char *buf)
5657

5758
guard(thermal_zone)(tz);
5859

59-
if (tz->mode == THERMAL_DEVICE_ENABLED)
60-
return sysfs_emit(buf, "enabled\n");
61-
62-
return sysfs_emit(buf, "disabled\n");
60+
return sysfs_emit(buf, "%s\n",
61+
str_enabled_disabled(tz->mode == THERMAL_DEVICE_ENABLED));
6362
}
6463

6564
static ssize_t

0 commit comments

Comments
 (0)