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

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