[PATCH v2 19/33] HID: logitech-hidpp: use sysfs_emit() in hidpp_ff_range_show()

From: Dmitry Torokhov

Date: Wed Nov 11 2026 - 02:00:29 EST


Formatting the G920 wheel range sysfs output with scnprintf() passes
buffer sizes manually instead of using the standard sysfs helper. Use
sysfs_emit() in hidpp_ff_range_show() to align with current kernel sysfs
conventions.

Tested-by: Gideon Heinz <gideonheinz02@xxxxxxxxx>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
---
drivers/hid/hid-logitech-hidpp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index bad6739c618c..03d2e9077675 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -2724,7 +2724,7 @@ static ssize_t hidpp_ff_range_show(struct device *dev, struct device_attribute *
struct hidpp_device *hidpp = hid_get_drvdata(hid);
struct g920_data *g920 = hidpp->private_data;

- return scnprintf(buf, PAGE_SIZE, "%u\n", g920->range);
+ return sysfs_emit(buf, "%u\n", g920->range);
}

static ssize_t hidpp_ff_range_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)

--
2.56.0.542.g3ef89b7020-goog