diff options
author | Xuezhi Zhang <zhangxuezhi1@coolpad.com> | 2022-10-18 10:51:18 +0300 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2022-10-18 11:28:41 +0300 |
commit | 0a974e6ae43b3a6aac63dfdfdf171be205fa370c (patch) | |
tree | 1516b4c56a7e7694aa3577eb3d614daf39aac20c /drivers/video/fbdev | |
parent | 9750737130dc7b2e4c6f4f33e7e2381e49014299 (diff) | |
download | linux-0a974e6ae43b3a6aac63dfdfdf171be205fa370c.tar.xz |
fbdev: gbefb: Convert sysfs snprintf to sysfs_emit
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@coolpad.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r-- | drivers/video/fbdev/gbefb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/fbdev/gbefb.c b/drivers/video/fbdev/gbefb.c index 1582c718329c..000b4aa44241 100644 --- a/drivers/video/fbdev/gbefb.c +++ b/drivers/video/fbdev/gbefb.c @@ -1060,14 +1060,14 @@ static const struct fb_ops gbefb_ops = { static ssize_t gbefb_show_memsize(struct device *dev, struct device_attribute *attr, char *buf) { - return snprintf(buf, PAGE_SIZE, "%u\n", gbe_mem_size); + return sysfs_emit(buf, "%u\n", gbe_mem_size); } static DEVICE_ATTR(size, S_IRUGO, gbefb_show_memsize, NULL); static ssize_t gbefb_show_rev(struct device *device, struct device_attribute *attr, char *buf) { - return snprintf(buf, PAGE_SIZE, "%d\n", gbe_revision); + return sysfs_emit(buf, "%d\n", gbe_revision); } static DEVICE_ATTR(revision, S_IRUGO, gbefb_show_rev, NULL); |