dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Archit More <architmore303@gmail.com>
To: lizhi.hou@amd.com, mamin506@gmail.com, ogabbay@kernel.org
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Archit More <architmore303@gmail.com>
Subject: [RFC PATCH] accel/amdxdna: Replace sprintf() with sysfs_emit() in sysfs show functions
Date: Mon, 29 Jun 2026 20:37:03 +0530	[thread overview]
Message-ID: <20260629150703.71734-1-architmore303@gmail.com> (raw)

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@gmail.com>
---
 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


                 reply	other threads:[~2026-06-30  7:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260629150703.71734-1-architmore303@gmail.com \
    --to=architmore303@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizhi.hou@amd.com \
    --cc=mamin506@gmail.com \
    --cc=ogabbay@kernel.org \
    /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