From: Khaled Elnaggar <khaledelnaggarlinux@gmail.com>
To: jdelvare@suse.com, linux@roeck-us.net
Cc: Khaled Elnaggar <khaledelnaggarlinux@gmail.com>,
linux-kernel-mentees@lists.linux.dev, shuah@kernel.org,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] hwmon: max31827: use sysfs_emit() in temp1_resolution_show()
Date: Sat, 12 Jul 2025 16:14:46 +0300 [thread overview]
Message-ID: <20250712131447.326995-1-khaledelnaggarlinux@gmail.com> (raw)
Replace scnprintf() with sysfs_emit() in temp1_resolution_show(),
as recommended in Documentation/filesystems/sysfs.rst: show() callbacks
should use sysfs_emit() or sysfs_emit_at() to format values returned to
userspace.
Signed-off-by: Khaled Elnaggar <khaledelnaggarlinux@gmail.com>
---
drivers/hwmon/max31827.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/max31827.c b/drivers/hwmon/max31827.c
index 48e8f8ba4d05..c423cabcb28b 100644
--- a/drivers/hwmon/max31827.c
+++ b/drivers/hwmon/max31827.c
@@ -445,7 +445,7 @@ static ssize_t temp1_resolution_show(struct device *dev,
val = FIELD_GET(MAX31827_CONFIGURATION_RESOLUTION_MASK, val);
- return scnprintf(buf, PAGE_SIZE, "%u\n", max31827_resolutions[val]);
+ return sysfs_emit(buf, "%u\n", max31827_resolutions[val]);
}
static ssize_t temp1_resolution_store(struct device *dev,
--
2.47.2
next reply other threads:[~2025-07-12 13:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-12 13:14 Khaled Elnaggar [this message]
2025-07-16 14:48 ` [PATCH] hwmon: max31827: use sysfs_emit() in temp1_resolution_show() Guenter Roeck
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=20250712131447.326995-1-khaledelnaggarlinux@gmail.com \
--to=khaledelnaggarlinux@gmail.com \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel-mentees@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--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