lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 18 Oct 2022 10:29:18 +0200
From:   Helge Deller <deller@....de>
To:     Xuezhi Zhang <zhangxuezhi3@...il.com>, zhangxuezhi1@...lpad.com,
        jiasheng@...as.ac.cn
Cc:     linux-fbdev@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fbdev: gbefb: convert sysfs snprintf to sysfs_emit

On 10/18/22 09:51, Xuezhi Zhang wrote:
> From: Xuezhi Zhang <zhangxuezhi1@...lpad.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@...lpad.com>

applied.
Thanks!
Helge

> ---
>   drivers/video/fbdev/gbefb.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/fbdev/gbefb.c b/drivers/video/fbdev/gbefb.c
> index 1582c718329c..000b4aa44241 100644
> --- a/drivers/video/fbdev/gbefb.c
> +++ b/drivers/video/fbdev/gbefb.c
> @@ -1060,14 +1060,14 @@ static const struct fb_ops gbefb_ops = {
>
>   static ssize_t gbefb_show_memsize(struct device *dev, struct device_attribute *attr, char *buf)
>   {
> -	return snprintf(buf, PAGE_SIZE, "%u\n", gbe_mem_size);
> +	return sysfs_emit(buf, "%u\n", gbe_mem_size);
>   }
>
>   static DEVICE_ATTR(size, S_IRUGO, gbefb_show_memsize, NULL);
>
>   static ssize_t gbefb_show_rev(struct device *device, struct device_attribute *attr, char *buf)
>   {
> -	return snprintf(buf, PAGE_SIZE, "%d\n", gbe_revision);
> +	return sysfs_emit(buf, "%d\n", gbe_revision);
>   }
>
>   static DEVICE_ATTR(revision, S_IRUGO, gbefb_show_rev, NULL);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ