[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250902090258.1170896-1-cuitao@kylinos.cn>
Date: Tue,  2 Sep 2025 17:02:58 +0800
From: cuitao <cuitao@...inos.cn>
To: chenhuacai@...nel.org,
	loongarch@...ts.linux.dev
Cc: kernel@...0n.name,
	jiaxun.yang@...goat.com,
	linmq006@...il.com,
	ziyao@...root.org,
	linux-kernel@...r.kernel.org,
	cuitao <cuitao@...inos.cn>
Subject: [PATCH] LoongArch: replace sprintf() with sysfs_emit()
As Documentation/filesystems/sysfs.rst suggested, show() should only use
sysfs_emit() or sysfs_emit_at() when formatting the value to be returned
to user space.
No functional change intended.
Signed-off-by: cuitao <cuitao@...inos.cn>
---
 arch/loongarch/kernel/env.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/loongarch/kernel/env.c b/arch/loongarch/kernel/env.c
index c0a5dc9aeae2..19e30206b6e7 100644
--- a/arch/loongarch/kernel/env.c
+++ b/arch/loongarch/kernel/env.c
@@ -86,7 +86,7 @@ late_initcall(fdt_cpu_clk_init);
 static ssize_t boardinfo_show(struct kobject *kobj,
 			      struct kobj_attribute *attr, char *buf)
 {
-	return sprintf(buf,
+	return sysfs_emit(buf,
 		"BIOS Information\n"
 		"Vendor\t\t\t: %s\n"
 		"Version\t\t\t: %s\n"
-- 
2.33.0
Powered by blists - more mailing lists