Linux CXL
 help / color / mirror / Atom feed
* [PATCH] cxl/core: use sysfs_emit() for attr's _show()
@ 2024-01-12  6:27 Shiyang Ruan
  2024-01-12 11:20 ` Jonathan Cameron
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shiyang Ruan @ 2024-01-12  6:27 UTC (permalink / raw)
  To: dan.j.williams, ira.weiny, dave.jiang; +Cc: linux-cxl

sprintf() is deprecated for sysfs, use preferred sysfs_emit() instead.

Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.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);
 
-- 
2.34.1


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

* Re: [PATCH] cxl/core: use sysfs_emit() for attr's _show()
  2024-01-12  6:27 [PATCH] cxl/core: use sysfs_emit() for attr's _show() Shiyang Ruan
@ 2024-01-12 11:20 ` Jonathan Cameron
  2024-01-12 16:19 ` Dave Jiang
  2024-01-12 19:47 ` fan
  2 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2024-01-12 11:20 UTC (permalink / raw)
  To: Shiyang Ruan; +Cc: dan.j.williams, ira.weiny, dave.jiang, linux-cxl

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);
>  


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

* Re: [PATCH] cxl/core: use sysfs_emit() for attr's _show()
  2024-01-12  6:27 [PATCH] cxl/core: use sysfs_emit() for attr's _show() Shiyang Ruan
  2024-01-12 11:20 ` Jonathan Cameron
@ 2024-01-12 16:19 ` Dave Jiang
  2024-01-12 19:47 ` fan
  2 siblings, 0 replies; 4+ messages in thread
From: Dave Jiang @ 2024-01-12 16:19 UTC (permalink / raw)
  To: Shiyang Ruan, dan.j.williams, ira.weiny; +Cc: linux-cxl



On 1/11/24 23:27, Shiyang Ruan wrote:
> sprintf() is deprecated for sysfs, use preferred sysfs_emit() instead.
> 
> Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>

Reviewed-by: Dave Jiang <dave.jiang@intel.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);
>  

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

* Re: [PATCH] cxl/core: use sysfs_emit() for attr's _show()
  2024-01-12  6:27 [PATCH] cxl/core: use sysfs_emit() for attr's _show() Shiyang Ruan
  2024-01-12 11:20 ` Jonathan Cameron
  2024-01-12 16:19 ` Dave Jiang
@ 2024-01-12 19:47 ` fan
  2 siblings, 0 replies; 4+ messages in thread
From: fan @ 2024-01-12 19:47 UTC (permalink / raw)
  To: Shiyang Ruan; +Cc: dan.j.williams, ira.weiny, dave.jiang, linux-cxl

On Fri, Jan 12, 2024 at 02:27:09PM +0800, Shiyang Ruan wrote:
> sprintf() is deprecated for sysfs, use preferred sysfs_emit() instead.
> 
> Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
> ---

Reviewed-by: Fan Ni <fan.ni@samsung.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);
>  
> -- 
> 2.34.1
> 

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

end of thread, other threads:[~2024-01-12 19:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-12  6:27 [PATCH] cxl/core: use sysfs_emit() for attr's _show() Shiyang Ruan
2024-01-12 11:20 ` Jonathan Cameron
2024-01-12 16:19 ` Dave Jiang
2024-01-12 19:47 ` fan

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