diff options
author | ye xingchen <ye.xingchen@zte.com.cn> | 2022-12-05 11:31:39 +0300 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2022-12-14 22:01:51 +0300 |
commit | 522d5226eed96a7df6662857500777a74d60d341 (patch) | |
tree | ee3cf3a7c29ce5b634dc8cbdf6533fec2293e3b7 | |
parent | f2ff0c430fed8c6a6d64d11a41f0582bf8bba6f7 (diff) | |
download | linux-522d5226eed96a7df6662857500777a74d60d341.tar.xz |
fbdev: uvesafb: 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>
-rw-r--r-- | drivers/video/fbdev/uvesafb.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c index 2bb95c35ab2a..f09f483c219b 100644 --- a/drivers/video/fbdev/uvesafb.c +++ b/drivers/video/fbdev/uvesafb.c @@ -1580,7 +1580,7 @@ static ssize_t uvesafb_show_vendor(struct device *dev, struct uvesafb_par *par = info->par; if (par->vbe_ib.oem_vendor_name_ptr) - return scnprintf(buf, PAGE_SIZE, "%s\n", (char *) + return sysfs_emit(buf, "%s\n", (char *) (&par->vbe_ib) + par->vbe_ib.oem_vendor_name_ptr); else return 0; @@ -1595,7 +1595,7 @@ static ssize_t uvesafb_show_product_name(struct device *dev, struct uvesafb_par *par = info->par; if (par->vbe_ib.oem_product_name_ptr) - return scnprintf(buf, PAGE_SIZE, "%s\n", (char *) + return sysfs_emit(buf, "%s\n", (char *) (&par->vbe_ib) + par->vbe_ib.oem_product_name_ptr); else return 0; @@ -1610,7 +1610,7 @@ static ssize_t uvesafb_show_product_rev(struct device *dev, struct uvesafb_par *par = info->par; if (par->vbe_ib.oem_product_rev_ptr) - return scnprintf(buf, PAGE_SIZE, "%s\n", (char *) + return sysfs_emit(buf, "%s\n", (char *) (&par->vbe_ib) + par->vbe_ib.oem_product_rev_ptr); else return 0; @@ -1625,7 +1625,7 @@ static ssize_t uvesafb_show_oem_string(struct device *dev, struct uvesafb_par *par = info->par; if (par->vbe_ib.oem_string_ptr) - return scnprintf(buf, PAGE_SIZE, "%s\n", + return sysfs_emit(buf, "%s\n", (char *)(&par->vbe_ib) + par->vbe_ib.oem_string_ptr); else return 0; @@ -1639,7 +1639,7 @@ static ssize_t uvesafb_show_nocrtc(struct device *dev, struct fb_info *info = dev_get_drvdata(dev); struct uvesafb_par *par = info->par; - return scnprintf(buf, PAGE_SIZE, "%d\n", par->nocrtc); + return sysfs_emit(buf, "%d\n", par->nocrtc); } static ssize_t uvesafb_store_nocrtc(struct device *dev, |