Re: [PATCH] hwmon: (dme1737) Use str_yes_no() helper in dme1737_init_device()

From: Guenter Roeck

Date: Mon Nov 09 2026 - 10:04:39 EST


On 11/9/26 04:11, Archit More wrote:
Replace open-coded ternary string choices ("yes" / "no") with the
standard str_yes_no() helper from <linux/string_choices.h>.

Signed-off-by: Archit More <architmore303@xxxxxxxxx>

Please refrain from submitting such patches. I will not apply them.
The Linux kernel is known to have thousands of bugs. If you want
to do some good, concentrate on fixing some of those.

Thanks,
Guenter

---
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 b1bd3682c5fb..c3bf5f4ef941 100644
--- a/drivers/hwmon/dme1737.c
+++ b/drivers/hwmon/dme1737.c
@@ -17,6 +17,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
+#include <linux/string_choices.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
#include <linux/platform_device.h>
@@ -2316,13 +2317,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 */