Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [PATCH] video: fbdev: sm501fb: onvert sysfs snprintf to sysfs_emit
@ 2022-10-18  6:25 Xuezhi Zhang
  2022-10-18  6:44 ` Helge Deller
  0 siblings, 1 reply; 2+ messages in thread
From: Xuezhi Zhang @ 2022-10-18  6:25 UTC (permalink / raw)
  To: deller, zhangxuezhi1, wsa+renesas; +Cc: linux-fbdev, dri-devel, linux-kernel

From: Xuezhi Zhang <zhangxuezhi1@coolpad.com>

Follow the advice of the Documentation/filesystems/sysfs.rst
and show() should only use sysfs_emit() or sysfs_emit_at()
when formatting the value to be returned to user space.

Signed-off-by: Xuezhi Zhang <zhangxuezhi1@coolpad.com>
---
 drivers/video/fbdev/sm501fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
index fce6cfbadfd6..f743bfbde2a6 100644
--- a/drivers/video/fbdev/sm501fb.c
+++ b/drivers/video/fbdev/sm501fb.c
@@ -1166,7 +1166,7 @@ static ssize_t sm501fb_crtsrc_show(struct device *dev,
 	ctrl = smc501_readl(info->regs + SM501_DC_CRT_CONTROL);
 	ctrl &= SM501_DC_CRT_CONTROL_SEL;
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", ctrl ? "crt" : "panel");
+	return sysfs_emit(buf, "%s\n", ctrl ? "crt" : "panel");
 }
 
 /* sm501fb_crtsrc_show
-- 
2.25.1


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

* Re: [PATCH] video: fbdev: sm501fb: onvert sysfs snprintf to sysfs_emit
  2022-10-18  6:25 [PATCH] video: fbdev: sm501fb: onvert sysfs snprintf to sysfs_emit Xuezhi Zhang
@ 2022-10-18  6:44 ` Helge Deller
  0 siblings, 0 replies; 2+ messages in thread
From: Helge Deller @ 2022-10-18  6:44 UTC (permalink / raw)
  To: Xuezhi Zhang, zhangxuezhi1, wsa+renesas
  Cc: linux-fbdev, dri-devel, linux-kernel

On 10/18/22 08:25, Xuezhi Zhang wrote:
> From: Xuezhi Zhang <zhangxuezhi1@coolpad.com>
>
> Follow the advice of the Documentation/filesystems/sysfs.rst
> and show() should only use sysfs_emit() or sysfs_emit_at()
> when formatting the value to be returned to user space.
>
> Signed-off-by: Xuezhi Zhang <zhangxuezhi1@coolpad.com>

applied.
Thanks!
Helge

> ---
>   drivers/video/fbdev/sm501fb.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
> index fce6cfbadfd6..f743bfbde2a6 100644
> --- a/drivers/video/fbdev/sm501fb.c
> +++ b/drivers/video/fbdev/sm501fb.c
> @@ -1166,7 +1166,7 @@ static ssize_t sm501fb_crtsrc_show(struct device *dev,
>   	ctrl = smc501_readl(info->regs + SM501_DC_CRT_CONTROL);
>   	ctrl &= SM501_DC_CRT_CONTROL_SEL;
>
> -	return snprintf(buf, PAGE_SIZE, "%s\n", ctrl ? "crt" : "panel");
> +	return sysfs_emit(buf, "%s\n", ctrl ? "crt" : "panel");
>   }
>
>   /* sm501fb_crtsrc_show


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

end of thread, other threads:[~2022-10-18  6:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-18  6:25 [PATCH] video: fbdev: sm501fb: onvert sysfs snprintf to sysfs_emit Xuezhi Zhang
2022-10-18  6:44 ` Helge Deller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox