Linux CXL
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Shiyang Ruan <ruansy.fnst@fujitsu.com>
Cc: <dan.j.williams@intel.com>, <ira.weiny@intel.com>,
	<dave.jiang@intel.com>, <linux-cxl@vger.kernel.org>
Subject: Re: [PATCH] cxl/core: use sysfs_emit() for attr's _show()
Date: Fri, 12 Jan 2024 11:20:03 +0000	[thread overview]
Message-ID: <20240112112003.00000e46@Huawei.com> (raw)
In-Reply-To: <20240112062709.2490947-1-ruansy.fnst@fujitsu.com>

On Fri, 12 Jan 2024 14:27:09 +0800
Shiyang Ruan <ruansy.fnst@fujitsu.com> wrote:

> sprintf() is deprecated for sysfs, use preferred sysfs_emit() instead.
> 
> Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
FWIW this looks fine to me.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/cxl/core/memdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cxl/core/memdev.c b/drivers/cxl/core/memdev.c
> index 2f43d368ba07..dae8802ecdb0 100644
> --- a/drivers/cxl/core/memdev.c
> +++ b/drivers/cxl/core/memdev.c
> @@ -114,7 +114,7 @@ static DEVICE_ATTR_RO(serial);
>  static ssize_t numa_node_show(struct device *dev, struct device_attribute *attr,
>  			      char *buf)
>  {
> -	return sprintf(buf, "%d\n", dev_to_node(dev));
> +	return sysfs_emit(buf, "%d\n", dev_to_node(dev));
>  }
>  static DEVICE_ATTR_RO(numa_node);
>  


  reply	other threads:[~2024-01-12 11:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-12  6:27 [PATCH] cxl/core: use sysfs_emit() for attr's _show() Shiyang Ruan
2024-01-12 11:20 ` Jonathan Cameron [this message]
2024-01-12 16:19 ` Dave Jiang
2024-01-12 19:47 ` fan

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=20240112112003.00000e46@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=ruansy.fnst@fujitsu.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