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>
This commit is contained in:
Родитель
f2ff0c430f
Коммит
522d5226ee
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче