[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251215024416.40841-1-chenzhang@kylinos.cn>
Date: Mon, 15 Dec 2025 10:44:16 +0800
From: chen zhang <chenzhang@...inos.cn>
To: miklos@...redi.hu,
mszeredi@...hat.com,
joannelkoong@...il.com,
josef@...icpanda.com
Cc: linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org,
chenzhang_0901@....com,
chen zhang <chenzhang@...inos.cn>
Subject: [PATCH] fuse: use sysfs_emit() instead of sprintf()
Follow the advice in Documentation/filesystems/sysfs.rst:
show() should only use sysfs_emit() or sysfs_emit_at() when formatting
the value to be returned to user space.
Signed-off-by: chen zhang <chenzhang@...inos.cn>
---
fs/fuse/cuse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c
index 28c96961e85d..0c8e7259f489 100644
--- a/fs/fuse/cuse.c
+++ b/fs/fuse/cuse.c
@@ -581,7 +581,7 @@ static ssize_t cuse_class_waiting_show(struct device *dev,
{
struct cuse_conn *cc = dev_get_drvdata(dev);
- return sprintf(buf, "%d\n", atomic_read(&cc->fc.num_waiting));
+ return sysfs_emit(buf, "%d\n", atomic_read(&cc->fc.num_waiting));
}
static DEVICE_ATTR(waiting, 0400, cuse_class_waiting_show, NULL);
--
2.25.1
Powered by blists - more mailing lists