diff mbox series

drm/panel: panel-dsi-cm: Convert sysfs sprintf/snprintf family to sysfs_emit

Message ID 1618196503-32895-1-git-send-email-tiantao6@hisilicon.com (mailing list archive)
State New, archived
Headers show
Series drm/panel: panel-dsi-cm: Convert sysfs sprintf/snprintf family to sysfs_emit | expand

Commit Message

tiantao (H) April 12, 2021, 3:01 a.m. UTC
Fix the following coccicheck warning:
drivers/gpu/drm/panel/panel-dsi-cm.c:271:8-16: WARNING:
use scnprintf or sprintf
drivers/gpu/drm/panel/panel-dsi-cm.c:251:8-16: WARNING:
use scnprintf or sprintf

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/gpu/drm/panel/panel-dsi-cm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/panel/panel-dsi-cm.c b/drivers/gpu/drm/panel/panel-dsi-cm.c
index af381d7..422d689 100644
--- a/drivers/gpu/drm/panel/panel-dsi-cm.c
+++ b/drivers/gpu/drm/panel/panel-dsi-cm.c
@@ -247,7 +247,7 @@  static ssize_t num_dsi_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 hw_revision_show(struct device *dev,
@@ -267,7 +267,7 @@  static ssize_t 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 DEVICE_ATTR_RO(num_dsi_errors);