[PATCH] w1: therm: Use str_yes_no helper in w1_slave_show

From: Thorsten Blum

Date: Wed Nov 05 2025 - 11:19:44 EST


Replace hard-coded strings with the str_yes_no() helper function. This
unifies the output and helps the linker with deduplication, which can
result in a smaller binary.

Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
---
drivers/w1/slaves/w1_therm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
index 9ccedb3264fb..0b54ab7f237e 100644
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -17,6 +17,7 @@
#include <linux/delay.h>
#include <linux/hwmon.h>
#include <linux/string.h>
+#include <linux/string_choices.h>
#include <linux/jiffies.h>

#include <linux/w1.h>
@@ -1609,7 +1610,7 @@ static ssize_t w1_slave_show(struct device *device,
for (i = 0; i < 9; ++i)
c -= snprintf(buf + PAGE_SIZE - c, c, "%02x ", info.rom[i]);
c -= snprintf(buf + PAGE_SIZE - c, c, ": crc=%02x %s\n",
- info.crc, (info.verdict) ? "YES" : "NO");
+ info.crc, str_yes_no(info.verdict));

if (info.verdict)
memcpy(family_data, info.rom, sizeof(info.rom));
--
2.51.1