[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <202212011950119139713@zte.com.cn>
Date: Thu, 1 Dec 2022 19:50:11 +0800 (CST)
From: <ye.xingchen@....com.cn>
To: <ulf.hansson@...aro.org>
Cc: <maximlevitsky@...il.com>, <oakad@...oo.com>, <axboe@...nel.dk>,
<hare@...e.de>, <linux-mmc@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH] memstick/mspro_block: use sysfs_emit() to instead of scnprintf()
From: ye xingchen <ye.xingchen@....com.cn>
Follow the advice of the Documentation/filesystems/sysfs.rst and show()
should only use sysfs_emit() or sysfs_emit_at() when formatting the
value to be returned to user space.
Signed-off-by: ye xingchen <ye.xingchen@....com.cn>
---
drivers/memstick/core/mspro_block.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c
index 61cf75d4a01e..ae3a5dc00344 100644
--- a/drivers/memstick/core/mspro_block.c
+++ b/drivers/memstick/core/mspro_block.c
@@ -356,7 +356,7 @@ static ssize_t mspro_block_attr_show_modelname(struct device *dev,
struct mspro_sys_attr,
dev_attr);
- return scnprintf(buffer, PAGE_SIZE, "%s", (char *)s_attr->data);
+ return sysfs_emit(buffer, "%s\n", (char *)s_attr->data);
}
static ssize_t mspro_block_attr_show_mbr(struct device *dev,
--
2.25.1
Powered by blists - more mailing lists