projects/linux·commit 73bf93ed

cxl/core: use sysfs_emit() for attr's _show()

73bf93ed · Shiyang Ruan <[email protected]> · 2024-01-12 14:27:09 +08:00

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

Signed-off-by: Shiyang Ruan <[email protected]>
Reviewed-by: Jonathan Cameron <[email protected]>
Reviewed-by: Dave Jiang <[email protected]>
Reviewed-by: Fan Ni <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dan Williams <[email protected]>
Commit
73bf93edeeea866b0b6efbc8d2595bdaaba7f1a5
Parents
36013115

Changes

1 files changed · +1 −1

FileStatusAddDelContent
drivers/cxl/core/memdev.cmodified+1−1View file

drivers/cxl/core/memdev.c

View file
diff --git a/drivers/cxl/core/memdev.c b/drivers/cxl/core/memdev.c
index 2f43d36..dae8802 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);