[PATCH] HID: hid-msi: Use str_true_false() helper
From: Aryan Sinha
Date: Fri Oct 16 2026 - 06:24:09 EST
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 <sinha.aryan03@xxxxxxxxx>
---
drivers/hid/hid-msi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/hid-msi.c b/drivers/hid/hid-msi.c
index 3225d3bf6..4822b5d6d 100644
--- a/drivers/hid/hid-msi.c
+++ b/drivers/hid/hid-msi.c
@@ -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);
--
2.46.0