* [PATCH] hid: roccat-isku: replace snprintf with sysfs_emit
@ 2022-02-09 0:45 davidcomponentone
0 siblings, 0 replies; only message in thread
From: davidcomponentone @ 2022-02-09 0:45 UTC (permalink / raw)
To: erazor_de
Cc: davidcomponentone, jikos, benjamin.tissoires, linux-input,
linux-kernel, Yang Guang, Zeal Robot
From: Yang Guang <yang.guang5@zte.com.cn>
coccinelle report:
./drivers/hid/hid-roccat-isku.c:66:8-16:
WARNING: use scnprintf or sprintf
Use sysfs_emit instead of scnprintf or sprintf makes more sense.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Yang Guang <yang.guang5@zte.com.cn>
Signed-off-by: David Yang <davidcomponentone@gmail.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.30.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-02-09 0:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-09 0:45 [PATCH] hid: roccat-isku: replace snprintf with sysfs_emit davidcomponentone
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).