Skip to content

Commit b20a558

Browse files
ye xingchenhdeller
authored andcommitted
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 <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 522d522 commit b20a558

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/video/fbdev/sh_mobile_lcdcfb.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ overlay_alpha_show(struct device *dev, struct device_attribute *attr, char *buf)
11881188
struct fb_info *info = dev_get_drvdata(dev);
11891189
struct sh_mobile_lcdc_overlay *ovl = info->par;
11901190

1191-
return scnprintf(buf, PAGE_SIZE, "%u\n", ovl->alpha);
1191+
return sysfs_emit(buf, "%u\n", ovl->alpha);
11921192
}
11931193

11941194
static ssize_t
@@ -1226,7 +1226,7 @@ overlay_mode_show(struct device *dev, struct device_attribute *attr, char *buf)
12261226
struct fb_info *info = dev_get_drvdata(dev);
12271227
struct sh_mobile_lcdc_overlay *ovl = info->par;
12281228

1229-
return scnprintf(buf, PAGE_SIZE, "%u\n", ovl->mode);
1229+
return sysfs_emit(buf, "%u\n", ovl->mode);
12301230
}
12311231

12321232
static ssize_t
@@ -1265,7 +1265,7 @@ overlay_position_show(struct device *dev, struct device_attribute *attr,
12651265
struct fb_info *info = dev_get_drvdata(dev);
12661266
struct sh_mobile_lcdc_overlay *ovl = info->par;
12671267

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);
12691269
}
12701270

12711271
static ssize_t
@@ -1306,7 +1306,7 @@ overlay_rop3_show(struct device *dev, struct device_attribute *attr, char *buf)
13061306
struct fb_info *info = dev_get_drvdata(dev);
13071307
struct sh_mobile_lcdc_overlay *ovl = info->par;
13081308

1309-
return scnprintf(buf, PAGE_SIZE, "%u\n", ovl->rop3);
1309+
return sysfs_emit(buf, "%u\n", ovl->rop3);
13101310
}
13111311

13121312
static ssize_t

0 commit comments

Comments
 (0)