mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-06 05:02:31 +00:00
fbdev: panel-tpo-td043mtea1: Convert sprintf() 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(). CC: Helge Deller <deller@gmx.de> CC: linux-omap@vger.kernel.org CC: linux-fbdev@vger.kernel.org CC: dri-devel@lists.freedesktop.org Signed-off-by: Li Zhijian <lizhijian@fujitsu.com> Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
parent
c2d953276b
commit
763865fed8
@ -225,17 +225,12 @@ static ssize_t tpo_td043_gamma_show(struct device *dev,
|
||||
{
|
||||
struct panel_drv_data *ddata = dev_get_drvdata(dev);
|
||||
ssize_t len = 0;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(ddata->gamma); i++) {
|
||||
ret = snprintf(buf + len, PAGE_SIZE - len, "%u ",
|
||||
ddata->gamma[i]);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
len += ret;
|
||||
}
|
||||
buf[len - 1] = '\n';
|
||||
for (i = 0; i < ARRAY_SIZE(ddata->gamma); i++)
|
||||
len += sysfs_emit_at(buf, len, "%u ", ddata->gamma[i]);
|
||||
if (len)
|
||||
buf[len - 1] = '\n';
|
||||
|
||||
return len;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user