From: Khaled Elnaggar <khaledelnaggarlinux@gmail.com>
To: mkl@pengutronix.de, mailhol.vincent@wanadoo.fr
Cc: Khaled Elnaggar <khaledelnaggarlinux@gmail.com>,
linux-kernel-mentees@lists.linux.dev, shuah@kernel.org,
linux-can@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] can: janz-ican3: use sysfs_emit() in fwinfo_show()
Date: Sat, 12 Jul 2025 16:36:07 +0300 [thread overview]
Message-ID: <20250712133609.331904-1-khaledelnaggarlinux@gmail.com> (raw)
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
next reply other threads:[~2025-07-12 13:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-12 13:36 Khaled Elnaggar [this message]
2025-07-15 9:45 ` [PATCH] can: janz-ican3: use sysfs_emit() in fwinfo_show() Marc Kleine-Budde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250712133609.331904-1-khaledelnaggarlinux@gmail.com \
--to=khaledelnaggarlinux@gmail.com \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel-mentees@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=mailhol.vincent@wanadoo.fr \
--cc=mkl@pengutronix.de \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).