public inbox for linux-fpga@vger.kernel.org
 help / color / mirror / Atom feed
From: Dinh Nguyen <dinguyen@kernel.org>
To: mdf@kernel.org, yilun.xu@intel.com, trix@redhat.com
Cc: dinguyen@kernel.org, linux-fpga@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] fpga: bridge: Use sysfs_emit() instead of sprintf()
Date: Fri, 16 Jan 2026 22:36:26 -0600	[thread overview]
Message-ID: <20260117043626.2188219-1-dinguyen@kernel.org> (raw)

According to Documentation/filesystems/sysfs.rst, show() functions
should use sysfs_emit() when formatting the value to be returned to user
space.

Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
---
 drivers/fpga/fpga-bridge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c
index 8ef395b49bf8..d0d28d5f6112 100644
--- a/drivers/fpga/fpga-bridge.c
+++ b/drivers/fpga/fpga-bridge.c
@@ -290,7 +290,7 @@ static ssize_t name_show(struct device *dev,
 {
 	struct fpga_bridge *bridge = to_fpga_bridge(dev);
 
-	return sprintf(buf, "%s\n", bridge->name);
+	return sysfs_emit(buf, "%s\n", bridge->name);
 }
 
 static ssize_t state_show(struct device *dev,
-- 
2.42.0.411.g813d9a9188


             reply	other threads:[~2026-01-17  4:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-17  4:36 Dinh Nguyen [this message]
2026-01-22 10:03 ` [PATCH] fpga: bridge: Use sysfs_emit() instead of sprintf() Xu Yilun
2026-03-02  3:39   ` Xu Yilun

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=20260117043626.2188219-1-dinguyen@kernel.org \
    --to=dinguyen@kernel.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mdf@kernel.org \
    --cc=trix@redhat.com \
    --cc=yilun.xu@intel.com \
    /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