hwmon: (dme1737) Use str_yes_no() helper in dme1737_init_device()
Subsystems (2)
PATCH 1/1 hwmon: (dme1737) Use str_yes_no() helper in dme1737_init_device()
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 <[email protected]>
--- drivers/hwmon/dme1737.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/hwmon/dme1737.c +8 -7
@@ -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 */
Signature · 1 line
2.34.1
[email protected]
AI reviewSashiko has reviewed this patch and found no issues.
Quoted 4 lines
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 <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Guenter Roeck
maintainerQuoted 4 lines · Archit More
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 <[email protected]>
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
Quoted 37 lines
--- drivers/hwmon/dme1737.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)drivers/hwmon/dme1737.c +8
-7@@ -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 */