Thread (2 messages) 2 messages, 1 author, 2024-03-19

Re: [PATCH] drm,fbdev: td043mtea1: Convert sprintf() family to sysfs_emit() family

From: Zhijian Li (Fujitsu) <hidden>
Date: 2024-03-19 04:01:47
Also in: dri-devel, linux-omap, lkml


On 19/03/2024 11:43, Li Zhijian wrote:
quoted hunk ↗ jump to hunk
diff --git
a/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c
b/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c
index 477789cff8e0..040a17a05baa 100644
--- a/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c
+++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c
@@ -228,14 +228,10 @@ static ssize_t tpo_td043_gamma_show(struct device
*dev,
  	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]);
It should be
		len += sysfs_emit_at(buf, len, "%u ", ddata->gamma[i]);

just posted V2 to fix this.


Thanks
Zhijian
+	if (len)
+		buf[len - 1] = '\n';
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help