mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fpga: bridge: Use sysfs_emit() instead of sprintf()
@ 2026-01-17  4:36 Dinh Nguyen
  2026-01-22 10:03 ` Xu Yilun
  0 siblings, 1 reply; 3+ messages in thread
From: Dinh Nguyen @ 2026-01-17  4:36 UTC (permalink / raw)
  To: mdf, yilun.xu, trix; +Cc: dinguyen, linux-fpga, linux-kernel

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-02  3:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-17  4:36 [PATCH] fpga: bridge: Use sysfs_emit() instead of sprintf() Dinh Nguyen
2026-01-22 10:03 ` Xu Yilun
2026-03-02  3:39   ` Xu Yilun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®