From: Greg KH <gregkh@linuxfoundation.org>
To: Carlis <zhangxuezhi3@gmail.com>
Cc: devel@driverdev.osuosl.org, zhangxuezhi1@yulong.com,
linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: fbtft: change snprintf() to scnprintf()
Date: Fri, 2 Apr 2021 11:17:35 +0200 [thread overview]
Message-ID: <YGbhLxwZO9k/330J@kroah.com> (raw)
In-Reply-To: <20210402090501.152561-1-zhangxuezhi3@gmail.com>
On Fri, Apr 02, 2021 at 09:05:01AM +0000, Carlis wrote:
> From: Xuezhi Zhang <zhangxuezhi1@yulong.com>
>
> show() must not use snprintf() when formatting the value to
> be returned to user space.
Why not? The code is just fine as-is.
>
> Signed-off-by: Xuezhi Zhang <zhangxuezhi1@yulong.com>
> ---
> drivers/staging/fbtft/fbtft-sysfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/fbtft/fbtft-sysfs.c b/drivers/staging/fbtft/fbtft-sysfs.c
> index 26e52cc2de64..7df92db648d6 100644
> --- a/drivers/staging/fbtft/fbtft-sysfs.c
> +++ b/drivers/staging/fbtft/fbtft-sysfs.c
> @@ -199,7 +199,7 @@ static ssize_t show_debug(struct device *device,
> struct fb_info *fb_info = dev_get_drvdata(device);
> struct fbtft_par *par = fb_info->par;
>
> - return snprintf(buf, PAGE_SIZE, "%lu\n", par->debug);
> + return scnprintf(buf, PAGE_SIZE, "%lu\n", par->debug);
If you really want to "fix" this, please just use sysfs_emit(). This
change as-is, does nothing.
thanks,
greg k-h
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2021-04-02 9:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-02 9:05 [PATCH] staging: fbtft: change snprintf() to scnprintf() Carlis
2021-04-02 9:17 ` Greg KH [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YGbhLxwZO9k/330J@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=devel@driverdev.osuosl.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zhangxuezhi1@yulong.com \
--cc=zhangxuezhi3@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).