linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] can: janz-ican3: use sysfs_emit() in fwinfo_show()
@ 2025-07-12 13:36 Khaled Elnaggar
  2025-07-15  9:45 ` Marc Kleine-Budde
  0 siblings, 1 reply; 2+ messages in thread
From: Khaled Elnaggar @ 2025-07-12 13:36 UTC (permalink / raw)
  To: mkl, mailhol.vincent
  Cc: Khaled Elnaggar, linux-kernel-mentees, shuah, linux-can,
	linux-kernel

As recommended in Documentation/filesystems/sysfs.rst, show() callbacks
should use sysfs_emit() or sysfs_emit_at() to format values returned to
userspace. Replace scnprintf() with sysfs_emit() in fwinfo_show().

Signed-off-by: Khaled Elnaggar <khaledelnaggarlinux@gmail.com>
---
 drivers/net/can/janz-ican3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
index 60c7b83b4539..bfa5cbe88017 100644
--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -1867,7 +1867,7 @@ static ssize_t fwinfo_show(struct device *dev,
 {
 	struct ican3_dev *mod = netdev_priv(to_net_dev(dev));
 
-	return scnprintf(buf, PAGE_SIZE, "%s\n", mod->fwinfo);
+	return sysfs_emit(buf, "%s\n", mod->fwinfo);
 }
 
 static DEVICE_ATTR_RW(termination);
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-15  9:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-12 13:36 [PATCH] can: janz-ican3: use sysfs_emit() in fwinfo_show() Khaled Elnaggar
2025-07-15  9:45 ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).