]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
fpga: bridge: Use sysfs_emit() instead of sprintf()
authorDinh Nguyen <dinguyen@kernel.org>
Sat, 17 Jan 2026 04:36:26 +0000 (22:36 -0600)
committerXu Yilun <yilun.xu@linux.intel.com>
Mon, 2 Mar 2026 09:47:44 +0000 (17:47 +0800)
According to Documentation/filesystems/sysfs.rst, show() functions
should use sysfs_emit() when formatting the value to be returned to user
space.

This keeps consistent usage of sysfs_emit() across the same file.

Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
[ Yilun: clarify the necessity of the change in changelog ]
Reviewed-by: Xu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/20260117043626.2188219-1-dinguyen@kernel.org
Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>
drivers/fpga/fpga-bridge.c

index ca68c38aa4a144e65dd640a2041d2cb8748df46d..8c275bd48a0d99ef73ce8a6e975efe3cb6df8286 100644 (file)
@@ -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,