[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20221228060633.1459256-1-zhangxuezhi3@gmail.com>
Date: Wed, 28 Dec 2022 14:06:33 +0800
From: Xuezhi Zhang <zhangxuezhi3@...il.com>
To: zhangxuezhi1@...lpad.com, erazor_de@...rs.sourceforge.net,
jikos@...nel.org, benjamin.tissoires@...hat.com
Cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] HID: roccat: convert sysfs snprintf to sysfs_emit
From: Xuezhi Zhang <zhangxuezhi1@...lpad.com>
Follow the advice of the Documentation/filesystems/sysfs.rst
and show() should only use sysfs_emit() or sysfs_emit_at()
when formatting the value to be returned to user space.
Signed-off-by: Xuezhi Zhang <zhangxuezhi1@...lpad.com>
---
drivers/hid/hid-roccat-isku.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-roccat-isku.c b/drivers/hid/hid-roccat-isku.c
index e95d59cd8d07..d356a0ac770c 100644
--- a/drivers/hid/hid-roccat-isku.c
+++ b/drivers/hid/hid-roccat-isku.c
@@ -63,7 +63,7 @@ static ssize_t isku_sysfs_show_actual_profile(struct device *dev,
{
struct isku_device *isku =
hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
- return snprintf(buf, PAGE_SIZE, "%d\n", isku->actual_profile);
+ return sysfs_emit(buf, "%d\n", isku->actual_profile);
}
static ssize_t isku_sysfs_set_actual_profile(struct device *dev,
--
2.25.1
Powered by blists - more mailing lists