Commit 763865fe authored by Li Zhijian's avatar Li Zhijian Committed by Helge Deller

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: default avatarLi Zhijian <lizhijian@fujitsu.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent c2d95327
...@@ -225,17 +225,12 @@ static ssize_t tpo_td043_gamma_show(struct device *dev, ...@@ -225,17 +225,12 @@ static ssize_t tpo_td043_gamma_show(struct device *dev,
{ {
struct panel_drv_data *ddata = dev_get_drvdata(dev); struct panel_drv_data *ddata = dev_get_drvdata(dev);
ssize_t len = 0; ssize_t len = 0;
int ret;
int i; int i;
for (i = 0; i < ARRAY_SIZE(ddata->gamma); i++) { for (i = 0; i < ARRAY_SIZE(ddata->gamma); i++)
ret = snprintf(buf + len, PAGE_SIZE - len, "%u ", len += sysfs_emit_at(buf, len, "%u ", ddata->gamma[i]);
ddata->gamma[i]); if (len)
if (ret < 0) buf[len - 1] = '\n';
return ret;
len += ret;
}
buf[len - 1] = '\n';
return len; return len;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment