Skip to content

Commit 748c7eb

Browse files
zhijianli88hdeller
authored andcommitted
fbdev: uvesafb: Convert sprintf/snprintf to sysfs_emit
Per filesystems/sysfs.rst, show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. coccinelle complains that there are still a couple of functions that use snprintf(). Convert them to sysfs_emit(). sprintf() will be converted as weel if they have. Generally, this patch is generated by make coccicheck M=<path/to/file> MODE=patch \ COCCI=scripts/coccinelle/api/device_attr_show.cocci No functional change intended CC: Helge Deller <[email protected]> CC: [email protected] CC: [email protected] Signed-off-by: Li Zhijian <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 72fee6b commit 748c7eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/video/fbdev/uvesafb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@ static ssize_t uvesafb_show_vbe_ver(struct device *dev,
15461546
struct fb_info *info = dev_get_drvdata(dev);
15471547
struct uvesafb_par *par = info->par;
15481548

1549-
return snprintf(buf, PAGE_SIZE, "%.4x\n", par->vbe_ib.vbe_version);
1549+
return sysfs_emit(buf, "%.4x\n", par->vbe_ib.vbe_version);
15501550
}
15511551

15521552
static DEVICE_ATTR(vbe_version, S_IRUGO, uvesafb_show_vbe_ver, NULL);

0 commit comments

Comments
 (0)