[PATCH 09/18] HID: logitech-hidpp: use sysfs_emit() in hidpp_ff_range_show()

From: Dmitry Torokhov

Date: Mon Nov 09 2026 - 01:11:53 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.

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 0a82914ea314..1ed940352fd2 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -2784,7 +2784,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.506.g506a7eabc5-goog