[RFC PATCH] accel/amdxdna: Replace sprintf() with sysfs_emit() in sysfs show functions

From: Archit More

Date: Mon Jun 29 2026 - 11:20:27 EST


Documentation/filesystems/sysfs.rst recommends using sysfs_emit()
instead of sprintf() in sysfs show() callbacks.

Replace the remaining sprintf() calls in amdxdna_sysfs.c with
sysfs_emit(). There is no functional change.

Signed-off-by: Archit More <architmore303@xxxxxxxxx>
---
drivers/accel/amdxdna/amdxdna_sysfs.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/accel/amdxdna/amdxdna_sysfs.c b/drivers/accel/amdxdna/amdxdna_sysfs.c
index d9e359ee8182..8b4749e6c380 100644
--- a/drivers/accel/amdxdna/amdxdna_sysfs.c
+++ b/drivers/accel/amdxdna/amdxdna_sysfs.c
@@ -18,9 +18,9 @@ static ssize_t vbnv_show(struct device *dev, struct device_attribute *attr, char
struct amdxdna_dev *xdna = dev_get_drvdata(dev);

if (!xdna->vbnv)
- return sprintf(buf, "\n");
+ return sysfs_emit(buf, "\n");

- return sprintf(buf, "%s\n", xdna->vbnv);
+ return sysfs_emit(buf, "%s\n", xdna->vbnv);
}
static DEVICE_ATTR_RO(vbnv);

@@ -28,7 +28,7 @@ static ssize_t device_type_show(struct device *dev, struct device_attribute *att
{
struct amdxdna_dev *xdna = dev_get_drvdata(dev);

- return sprintf(buf, "%d\n", xdna->dev_info->device_type);
+ return sysfs_emit(buf, "%d\n", xdna->dev_info->device_type);
}
static DEVICE_ATTR_RO(device_type);

@@ -36,7 +36,7 @@ static ssize_t fw_version_show(struct device *dev, struct device_attribute *attr
{
struct amdxdna_dev *xdna = dev_get_drvdata(dev);

- return sprintf(buf, "%d.%d.%d.%d\n", xdna->fw_ver.major,
+ return sysfs_emit(buf, "%d.%d.%d.%d\n", xdna->fw_ver.major,
xdna->fw_ver.minor, xdna->fw_ver.sub,
xdna->fw_ver.build);
}
--
2.34.1