Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fbdev: sh_mobile_lcdcfb: 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: ye xingchen <ye.xingchen@zte.com.cn>
Signed-off-by: Helge Deller <deller@gmx.de>

authored by

ye xingchen and committed by
Helge Deller
b20a558d 522d5226

+4 -4
+4 -4
drivers/video/fbdev/sh_mobile_lcdcfb.c
··· 1188 1188 struct fb_info *info = dev_get_drvdata(dev); 1189 1189 struct sh_mobile_lcdc_overlay *ovl = info->par; 1190 1190 1191 - return scnprintf(buf, PAGE_SIZE, "%u\n", ovl->alpha); 1191 + return sysfs_emit(buf, "%u\n", ovl->alpha); 1192 1192 } 1193 1193 1194 1194 static ssize_t ··· 1226 1226 struct fb_info *info = dev_get_drvdata(dev); 1227 1227 struct sh_mobile_lcdc_overlay *ovl = info->par; 1228 1228 1229 - return scnprintf(buf, PAGE_SIZE, "%u\n", ovl->mode); 1229 + return sysfs_emit(buf, "%u\n", ovl->mode); 1230 1230 } 1231 1231 1232 1232 static ssize_t ··· 1265 1265 struct fb_info *info = dev_get_drvdata(dev); 1266 1266 struct sh_mobile_lcdc_overlay *ovl = info->par; 1267 1267 1268 - return scnprintf(buf, PAGE_SIZE, "%d,%d\n", ovl->pos_x, ovl->pos_y); 1268 + return sysfs_emit(buf, "%d,%d\n", ovl->pos_x, ovl->pos_y); 1269 1269 } 1270 1270 1271 1271 static ssize_t ··· 1306 1306 struct fb_info *info = dev_get_drvdata(dev); 1307 1307 struct sh_mobile_lcdc_overlay *ovl = info->par; 1308 1308 1309 - return scnprintf(buf, PAGE_SIZE, "%u\n", ovl->rop3); 1309 + return sysfs_emit(buf, "%u\n", ovl->rop3); 1310 1310 } 1311 1311 1312 1312 static ssize_t