Skip to content

Commit 06a7053

Browse files
ankitchauhan2065brauner
authored andcommitted
fs/ecryptfs: replace snprintf with sysfs_emit in show function
Use sysfs_emit() instead of snprintf() in version_show() function to follow the preferred kernel API. Signed-off-by: Ankit Chauhan <ankitchauhan2065@gmail.com> Link: https://lore.kernel.org/20250619031536.19352-1-ankitchauhan2065@gmail.com Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 2b7c966 commit 06a7053

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/ecryptfs/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/fs_context.h>
2121
#include <linux/fs_parser.h>
2222
#include <linux/fs_stack.h>
23+
#include <linux/sysfs.h>
2324
#include <linux/slab.h>
2425
#include <linux/magic.h>
2526
#include "ecryptfs_kernel.h"
@@ -764,7 +765,7 @@ static struct kobject *ecryptfs_kobj;
764765
static ssize_t version_show(struct kobject *kobj,
765766
struct kobj_attribute *attr, char *buff)
766767
{
767-
return snprintf(buff, PAGE_SIZE, "%d\n", ECRYPTFS_VERSIONING_MASK);
768+
return sysfs_emit(buff, "%d\n", ECRYPTFS_VERSIONING_MASK);
768769
}
769770

770771
static struct kobj_attribute version_attr = __ATTR_RO(version);

0 commit comments

Comments
 (0)