HID: hid-msi: Use str_true_false() helper
Subsystems (2)
PATCH 1/1 HID: hid-msi: Use str_true_false() helper
Replace the open coded ternary in enabled_show() with the helper from string_choices.h. Gives Same output, but with one less conditional.
Signed-off-by Aryan Sinha <[email protected]>
--- drivers/hid/hid-msi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/hid/hid-msi.c +2 -1
@@ -28,6 +28,7 @@#include <linux/mutex.h> #include <linux/pm.h> #include <linux/spinlock.h> +#include <linux/string_choices.h> #include <linux/sysfs.h> #include <linux/types.h> #include <linux/unaligned.h>
@@ -1586,7 +1587,7 @@ static ssize_t enabled_show(struct device *dev,return -ENODEV ; } -return sysfs_emit (buf,"%s\n" , drvdata->rgb_enabled ?"true" :"false" ); +return sysfs_emit (buf,"%s\n" ,str_true_false (drvdata->rgb_enabled)); }static DEVICE_ATTR_RW (enabled);
Signature · 1 line
2.46.0
This is an accidental resend of a patch I already posted on 12 Oct, with nothing changed between the two:
https://lore.kernel.org/all/[email protected]/
Please drop this copy and use the original. Sorry for the duplication.
Aryan