video: fbdev: udlfb: replace snprintf in show functions with sysfs_emit
Use sysfs_emit instead of scnprintf, snprintf or sprintf. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Jing Yao <yao.jing2@zte.com.cn> Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
parent
c07a039cbb
commit
81a9982889
@ -1426,7 +1426,7 @@ static ssize_t metrics_bytes_rendered_show(struct device *fbdev,
|
||||
struct device_attribute *a, char *buf) {
|
||||
struct fb_info *fb_info = dev_get_drvdata(fbdev);
|
||||
struct dlfb_data *dlfb = fb_info->par;
|
||||
return snprintf(buf, PAGE_SIZE, "%u\n",
|
||||
return sysfs_emit(buf, "%u\n",
|
||||
atomic_read(&dlfb->bytes_rendered));
|
||||
}
|
||||
|
||||
@ -1434,7 +1434,7 @@ static ssize_t metrics_bytes_identical_show(struct device *fbdev,
|
||||
struct device_attribute *a, char *buf) {
|
||||
struct fb_info *fb_info = dev_get_drvdata(fbdev);
|
||||
struct dlfb_data *dlfb = fb_info->par;
|
||||
return snprintf(buf, PAGE_SIZE, "%u\n",
|
||||
return sysfs_emit(buf, "%u\n",
|
||||
atomic_read(&dlfb->bytes_identical));
|
||||
}
|
||||
|
||||
@ -1442,7 +1442,7 @@ static ssize_t metrics_bytes_sent_show(struct device *fbdev,
|
||||
struct device_attribute *a, char *buf) {
|
||||
struct fb_info *fb_info = dev_get_drvdata(fbdev);
|
||||
struct dlfb_data *dlfb = fb_info->par;
|
||||
return snprintf(buf, PAGE_SIZE, "%u\n",
|
||||
return sysfs_emit(buf, "%u\n",
|
||||
atomic_read(&dlfb->bytes_sent));
|
||||
}
|
||||
|
||||
@ -1450,7 +1450,7 @@ static ssize_t metrics_cpu_kcycles_used_show(struct device *fbdev,
|
||||
struct device_attribute *a, char *buf) {
|
||||
struct fb_info *fb_info = dev_get_drvdata(fbdev);
|
||||
struct dlfb_data *dlfb = fb_info->par;
|
||||
return snprintf(buf, PAGE_SIZE, "%u\n",
|
||||
return sysfs_emit(buf, "%u\n",
|
||||
atomic_read(&dlfb->cpu_kcycles_used));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user