projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e19c6bd
)
HID: cp2112: Use sysfs_emit() to instead of scnprintf()
author
Andy Shevchenko
<andriy.shevchenko@linux.intel.com>
Mon, 3 Jul 2023 18:52:20 +0000
(21:52 +0300)
committer
Benjamin Tissoires
<bentiss@kernel.org>
Fri, 28 Jul 2023 15:05:48 +0000
(17:05 +0200)
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link:
https://lore.kernel.org/r/20230703185222.50554-11-andriy.shevchenko@linux.intel.com
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
drivers/hid/hid-cp2112.c
patch
|
blob
|
history
diff --git
a/drivers/hid/hid-cp2112.c
b/drivers/hid/hid-cp2112.c
index 2eebb2b19501e6fb42377505f490a4effcfcef9f..1e45f5407d091f1e23f43e1709dca76975c391bb 100644
(file)
--- a/
drivers/hid/hid-cp2112.c
+++ b/
drivers/hid/hid-cp2112.c
@@
-893,7
+893,7
@@
static ssize_t name##_show(struct device *kdev, \
int ret = cp2112_get_usb_config(hdev, &cfg); \
if (ret) \
return ret; \
- return s
cnprintf(buf, PAGE_SIZE
, format, ##__VA_ARGS__); \
+ return s
ysfs_emit(buf
, format, ##__VA_ARGS__); \
} \
static DEVICE_ATTR_RW(name);