mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] HID: hid-msi: Use str_true_false() helper
@ 2026-10-12 15:45 Aryan Sinha
  0 siblings, 0 replies; only message in thread
From: Aryan Sinha @ 2026-10-12 15:45 UTC (permalink / raw)
  To: Derek J . Clark
  Cc: Jiri Kosina, Benjamin Tissoires, linux-input, linux-kernel, Aryan Sinha

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@gmail.com>
---
 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-12 15:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-12 15:45 [PATCH] HID: hid-msi: Use str_true_false() helper Aryan Sinha

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®