All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/panel: Convert sysfs sprintf/snprintf family to sysfs_emit
@ 2021-03-30  1:54 Tian Tao
  2021-04-08 10:51 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Tian Tao @ 2021-03-30  1:54 UTC (permalink / raw)
  To: thierry.reding, airlied, daniel; +Cc: dri-devel

Fix the following coccicheck warning:
drivers/gpu/drm/panel//panel-tpo-td043mtea1.c:217:8-16: WARNING:
use scnprintf or sprintf
drivers/gpu/drm/panel//panel-tpo-td043mtea1.c:189:8-16: WARNING:
use scnprintf or sprintf

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

diff --git a/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c b/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c
index 49e6c93..bacaf1b 100644
--- a/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c
+++ b/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c
@@ -186,7 +186,7 @@ static ssize_t vmirror_show(struct device *dev, struct device_attribute *attr,
 {
 	struct td043mtea1_panel *lcd = dev_get_drvdata(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", lcd->vmirror);
+	return sysfs_emit(buf, "%d\n", lcd->vmirror);
 }
 
 static ssize_t vmirror_store(struct device *dev, struct device_attribute *attr,
@@ -214,7 +214,7 @@ static ssize_t mode_show(struct device *dev, struct device_attribute *attr,
 {
 	struct td043mtea1_panel *lcd = dev_get_drvdata(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%d\n", lcd->mode);
+	return sysfs_emit(buf, "%d\n", lcd->mode);
 }
 
 static ssize_t mode_store(struct device *dev, struct device_attribute *attr,
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/panel: Convert sysfs sprintf/snprintf family to sysfs_emit
  2021-03-30  1:54 [PATCH] drm/panel: Convert sysfs sprintf/snprintf family to sysfs_emit Tian Tao
@ 2021-04-08 10:51 ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2021-04-08 10:51 UTC (permalink / raw)
  To: Tian Tao; +Cc: airlied, thierry.reding, dri-devel

On Tue, Mar 30, 2021 at 09:54:48AM +0800, Tian Tao wrote:
> Fix the following coccicheck warning:
> drivers/gpu/drm/panel//panel-tpo-td043mtea1.c:217:8-16: WARNING:
> use scnprintf or sprintf
> drivers/gpu/drm/panel//panel-tpo-td043mtea1.c:189:8-16: WARNING:
> use scnprintf or sprintf
> 
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/panel/panel-tpo-td043mtea1.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c b/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c
> index 49e6c93..bacaf1b 100644
> --- a/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c
> +++ b/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c
> @@ -186,7 +186,7 @@ static ssize_t vmirror_show(struct device *dev, struct device_attribute *attr,
>  {
>  	struct td043mtea1_panel *lcd = dev_get_drvdata(dev);
>  
> -	return snprintf(buf, PAGE_SIZE, "%d\n", lcd->vmirror);
> +	return sysfs_emit(buf, "%d\n", lcd->vmirror);
>  }
>  
>  static ssize_t vmirror_store(struct device *dev, struct device_attribute *attr,
> @@ -214,7 +214,7 @@ static ssize_t mode_show(struct device *dev, struct device_attribute *attr,
>  {
>  	struct td043mtea1_panel *lcd = dev_get_drvdata(dev);
>  
> -	return snprintf(buf, PAGE_SIZE, "%d\n", lcd->mode);
> +	return sysfs_emit(buf, "%d\n", lcd->mode);
>  }
>  
>  static ssize_t mode_store(struct device *dev, struct device_attribute *attr,
> -- 
> 2.7.4
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-08 10:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30  1:54 [PATCH] drm/panel: Convert sysfs sprintf/snprintf family to sysfs_emit Tian Tao
2021-04-08 10:51 ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.