Skip to content

Commit 0a974e6

Browse files
Xuezhi Zhanghdeller
authored andcommitted
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 <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 9750737 commit 0a974e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/video/fbdev/gbefb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,14 +1060,14 @@ static const struct fb_ops gbefb_ops = {
10601060

10611061
static ssize_t gbefb_show_memsize(struct device *dev, struct device_attribute *attr, char *buf)
10621062
{
1063-
return snprintf(buf, PAGE_SIZE, "%u\n", gbe_mem_size);
1063+
return sysfs_emit(buf, "%u\n", gbe_mem_size);
10641064
}
10651065

10661066
static DEVICE_ATTR(size, S_IRUGO, gbefb_show_memsize, NULL);
10671067

10681068
static ssize_t gbefb_show_rev(struct device *device, struct device_attribute *attr, char *buf)
10691069
{
1070-
return snprintf(buf, PAGE_SIZE, "%d\n", gbe_revision);
1070+
return sysfs_emit(buf, "%d\n", gbe_revision);
10711071
}
10721072

10731073
static DEVICE_ATTR(revision, S_IRUGO, gbefb_show_rev, NULL);

0 commit comments

Comments
 (0)