Skip to contentSkip to conversation

can: janz-ican3: use sysfs_emit() in fwinfo_show()

PATCH Applied Khaled Elnaggar 2 participants 2 messages Jul 12, 2025 – Jul 15, 2025 CAN network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 can: janz-ican3: use sysfs_emit() in fwinfo_show()

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().

---
 drivers/net/can/janz-ican3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/janz-ican3.c +1 -1
index 60c7b83b4539..bfa5cbe88017 100644
@@ -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);
Signature · 1 line
2.47.2
maintainer Applied
#1 lore raw
Quoted 5 lines · Khaled Elnaggar

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().

Applied to linux-can-next.

Thanks,
Marc

Signature · 4 lines
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |