diff mbox series

[v5,06/16] firmware: turris-mox-rwtm: Use sysfs_emit() instead of sprintf()

Message ID 20240831092050.23093-7-kabel@kernel.org (mailing list archive)
State New
Delegated to: Arnd Bergmann
Headers show
Series Updates for turris-mox-rwtm driver | expand

Commit Message

Marek BehĂșn Aug. 31, 2024, 9:20 a.m. UTC
Use sysfs_emit() instead of sprintf() in sysfs attribute .show()
method.

Signed-off-by: Marek BehĂșn <kabel@kernel.org>
---
 drivers/firmware/turris-mox-rwtm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c
index ca1eb1687d44..8923c4cabcd0 100644
--- a/drivers/firmware/turris-mox-rwtm.c
+++ b/drivers/firmware/turris-mox-rwtm.c
@@ -151,7 +151,7 @@  name##_show(struct kobject *kobj, struct kobj_attribute *a,	\
 	struct mox_rwtm *rwtm = to_rwtm(kobj);	\
 	if (!rwtm->has_##cat)					\
 		return -ENODATA;				\
-	return sprintf(buf, format, rwtm->name);		\
+	return sysfs_emit(buf, format, rwtm->name);		\
 }								\
 static struct kobj_attribute mox_attr_##name = __ATTR_RO(name)