Skip to content

Commit 5120bf0

Browse files
andy-shevBenjamin Tissoires
authored andcommitted
HID: cp2112: Use sysfs_emit() to instead of scnprintf()
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent e19c6bd commit 5120bf0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hid/hid-cp2112.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ static ssize_t name##_show(struct device *kdev, \
893893
int ret = cp2112_get_usb_config(hdev, &cfg); \
894894
if (ret) \
895895
return ret; \
896-
return scnprintf(buf, PAGE_SIZE, format, ##__VA_ARGS__); \
896+
return sysfs_emit(buf, format, ##__VA_ARGS__); \
897897
} \
898898
static DEVICE_ATTR_RW(name);
899899

0 commit comments

Comments
 (0)