From: Akshat Rawat <akshatrawat095@gmail.com>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org,
Akshat Rawat <akshatrawat095@gmail.com>
Subject: [PATCH] rtc: rv3029: use sysfs_emit() instead of sprintf()
Date: Fri, 30 Oct 2026 10:51:18 +0000 [thread overview]
Message-ID: <20261030105118.426-1-akshatrawat095@gmail.com> (raw)
Use sysfs_emit() instead of sprintf() in sysfs show callbacks
(rv3029_hwmon_show_temp and rv3029_hwmon_show_update_interval) to
comply with the recommended sysfs attribute formatting guidelines in
Documentation/filesystems/sysfs.rst.
Signed-off-by: Akshat Rawat <akshatrawat095@gmail.com>
---
drivers/rtc/rtc-rv3029c2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-rv3029c2.c b/drivers/rtc/rtc-rv3029c2.c
index c348b31928e9..33b73bbcaf52 100644
--- a/drivers/rtc/rtc-rv3029c2.c
+++ b/drivers/rtc/rtc-rv3029c2.c
@@ -601,7 +601,7 @@ static ssize_t rv3029_hwmon_show_temp(struct device *dev,
if (ret < 0)
return ret;
- return sprintf(buf, "%d\n", temp_mC);
+ return sysfs_emit(buf, "%d\n", temp_mC);
}
static ssize_t rv3029_hwmon_set_update_interval(struct device *dev,
@@ -654,7 +654,7 @@ static ssize_t rv3029_hwmon_show_update_interval(struct device *dev,
interval_ms = 0;
}
- return sprintf(buf, "%d\n", interval_ms);
+ return sysfs_emit(buf, "%d\n", interval_ms);
}
static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, rv3029_hwmon_show_temp,
--
2.56.0.windows.4
reply other threads:[~2026-10-30 10:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261030105118.426-1-akshatrawat095@gmail.com \
--to=akshatrawat095@gmail.com \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.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
all inboxes | Powered by JetHome®