mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] hwmon: (dme1737) Replace ternary operators with str_yes_no()
@ 2026-07-12 17:58 Joshua Crofts
  2026-07-12 18:17 ` Guenter Roeck
  0 siblings, 1 reply; 3+ messages in thread
From: Joshua Crofts @ 2026-07-12 17:58 UTC (permalink / raw)
  To: Juerg Haefliger, Guenter Roeck; +Cc: linux-hwmon, linux-kernel, Joshua Crofts

Remove the ternary operators and use str_yes_no() from string_choices.h
instead.

No functional change.

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
---
 drivers/hwmon/dme1737.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/hwmon/dme1737.c b/drivers/hwmon/dme1737.c
index 7e839308e58f..f28a9cfced55 100644
--- a/drivers/hwmon/dme1737.c
+++ b/drivers/hwmon/dme1737.c
@@ -27,6 +27,7 @@
 #include <linux/mutex.h>
 #include <linux/acpi.h>
 #include <linux/io.h>
+#include <linux/string_choices.h>
 
 /* ISA device, if found */
 static struct platform_device *pdev;
@@ -2314,13 +2315,13 @@ static int dme1737_init_device(struct device *dev)
 
 	dev_info(dev,
 		 "Optional features: pwm3=%s, pwm5=%s, pwm6=%s, fan3=%s, fan4=%s, fan5=%s, fan6=%s.\n",
-		 (data->has_features & HAS_PWM(2)) ? "yes" : "no",
-		 (data->has_features & HAS_PWM(4)) ? "yes" : "no",
-		 (data->has_features & HAS_PWM(5)) ? "yes" : "no",
-		 (data->has_features & HAS_FAN(2)) ? "yes" : "no",
-		 (data->has_features & HAS_FAN(3)) ? "yes" : "no",
-		 (data->has_features & HAS_FAN(4)) ? "yes" : "no",
-		 (data->has_features & HAS_FAN(5)) ? "yes" : "no");
+		 str_yes_no(data->has_features & HAS_PWM(2)),
+		 str_yes_no(data->has_features & HAS_PWM(4)),
+		 str_yes_no(data->has_features & HAS_PWM(5)),
+		 str_yes_no(data->has_features & HAS_FAN(2)),
+		 str_yes_no(data->has_features & HAS_FAN(3)),
+		 str_yes_no(data->has_features & HAS_FAN(4)),
+		 str_yes_no(data->has_features & HAS_FAN(5)));
 
 	reg = dme1737_read(data, DME1737_REG_TACH_PWM);
 	/* Inform if fan-to-pwm mapping differs from the default */

---
base-commit: ca078d004cf58137bcf8cb24a8b271397431ba58
change-id: 20260712-add-string-choices-dme1737-543445ef330d

Best regards,
-- 
Kind regards,
Joshua Crofts


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-12 18:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-12 17:58 [PATCH] hwmon: (dme1737) Replace ternary operators with str_yes_no() Joshua Crofts
2026-07-12 18:17 ` Guenter Roeck
2026-07-12 18:26   ` Joshua Crofts

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®