]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
video: fbdev: omapfb: panel-dsi-cm: Use sysfs_emit() instead of snprintf()
authorJing Yao <yao.jing2@zte.com.cn>
Fri, 5 Nov 2021 08:13:33 +0000 (08:13 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Apr 2022 12:14:55 +0000 (14:14 +0200)
[ Upstream commit f63658a59c3d439c8ad7b290f8ec270980e0f384 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c

index 87497a00241fdb0cb69882a94ca94d8df1bed91a..1c57ddaeff1b8e714040f40640c7386efa7ebfdb 100644 (file)
@@ -412,7 +412,7 @@ static ssize_t dsicm_num_errors_show(struct device *dev,
        if (r)
                return r;
 
-       return snprintf(buf, PAGE_SIZE, "%d\n", errors);
+       return sysfs_emit(buf, "%d\n", errors);
 }
 
 static ssize_t dsicm_hw_revision_show(struct device *dev,
@@ -442,7 +442,7 @@ static ssize_t dsicm_hw_revision_show(struct device *dev,
        if (r)
                return r;
 
-       return snprintf(buf, PAGE_SIZE, "%02x.%02x.%02x\n", id1, id2, id3);
+       return sysfs_emit(buf, "%02x.%02x.%02x\n", id1, id2, id3);
 }
 
 static ssize_t dsicm_store_ulps(struct device *dev,
@@ -490,7 +490,7 @@ static ssize_t dsicm_show_ulps(struct device *dev,
        t = ddata->ulps_enabled;
        mutex_unlock(&ddata->lock);
 
-       return snprintf(buf, PAGE_SIZE, "%u\n", t);
+       return sysfs_emit(buf, "%u\n", t);
 }
 
 static ssize_t dsicm_store_ulps_timeout(struct device *dev,
@@ -535,7 +535,7 @@ static ssize_t dsicm_show_ulps_timeout(struct device *dev,
        t = ddata->ulps_timeout;
        mutex_unlock(&ddata->lock);
 
-       return snprintf(buf, PAGE_SIZE, "%u\n", t);
+       return sysfs_emit(buf, "%u\n", t);
 }
 
 static DEVICE_ATTR(num_dsi_errors, S_IRUGO, dsicm_num_errors_show, NULL);