mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Bo Liu <liubo03@inspur.com>
Cc: <kwankhede@nvidia.com>, <kvm@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] vfio/mdev: Use sysfs_emit() to instead of sprintf()
Date: Mon, 30 Jan 2023 16:52:15 -0700	[thread overview]
Message-ID: <20230130165215.068a4c26.alex.williamson@redhat.com> (raw)
In-Reply-To: <20230129084117.2384-1-liubo03@inspur.com>

On Sun, 29 Jan 2023 03:41:17 -0500
Bo Liu <liubo03@inspur.com> wrote:

> 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: Bo Liu <liubo03@inspur.com>
> ---
>  drivers/vfio/mdev/mdev_sysfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/vfio/mdev/mdev_sysfs.c b/drivers/vfio/mdev/mdev_sysfs.c
> index abe3359dd477..e4490639d383 100644
> --- a/drivers/vfio/mdev/mdev_sysfs.c
> +++ b/drivers/vfio/mdev/mdev_sysfs.c
> @@ -96,7 +96,7 @@ static MDEV_TYPE_ATTR_RO(device_api);
>  static ssize_t name_show(struct mdev_type *mtype,
>  			 struct mdev_type_attribute *attr, char *buf)
>  {
> -	return sprintf(buf, "%s\n",
> +	return sysfs_emit(buf, "%s\n",
>  		mtype->pretty_name ? mtype->pretty_name : mtype->sysfs_name);
>  }
>  

Applied to vfio next branch for v6.3.  Thanks,

Alex


      parent reply	other threads:[~2023-01-30 23:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-29  8:41 Bo Liu
2023-01-30 18:30 ` Jason Gunthorpe
2023-01-30 23:52 ` Alex Williamson [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=20230130165215.068a4c26.alex.williamson@redhat.com \
    --to=alex.williamson@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwankhede@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liubo03@inspur.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

all inboxes | Powered by JetHome®