mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thorsten Blum <thorsten.blum@linux.dev>
To: Krzysztof Kozlowski <krzk@kernel.org>, Huisong Li <lihuisong@huawei.com>
Cc: Thorsten Blum <thorsten.blum@linux.dev>, linux-kernel@vger.kernel.org
Subject: [PATCH] w1: therm: Use str_yes_no helper in w1_slave_show
Date: Wed,  5 Nov 2025 17:18:56 +0100	[thread overview]
Message-ID: <20251105161900.43042-2-thorsten.blum@linux.dev> (raw)

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@linux.dev>
---
 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


             reply	other threads:[~2025-11-05 16:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-05 16:18 Thorsten Blum [this message]
2025-11-05 16:23 ` Krzysztof Kozlowski
2025-11-08 15:07   ` Thorsten Blum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251105161900.43042-2-thorsten.blum@linux.dev \
    --to=thorsten.blum@linux.dev \
    --cc=krzk@kernel.org \
    --cc=lihuisong@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®