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: rv3028: use sysfs_emit() instead of sprintf()
Date: Thu, 22 Oct 2026 08:12:42 +0000 [thread overview]
Message-ID: <20261022081242.421-1-akshatrawat095@gmail.com> (raw)
Use sysfs_emit() instead of sprintf() in sysfs show callbacks
(timestamp0_show and timestamp0_count_show) to conform to the
recommended sysfs attribute formatting guidelines in
Documentation/filesystems/sysfs.rst.
Signed-off-by: Akshat Rawat <akshatrawat095@gmail.com>
---
drivers/rtc/rtc-rv3028.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-rv3028.c b/drivers/rtc/rtc-rv3028.c
index d25e33d08..b3a5b1ef3 100644
--- a/drivers/rtc/rtc-rv3028.c
+++ b/drivers/rtc/rtc-rv3028.c
@@ -147,8 +147,8 @@ static ssize_t timestamp0_show(struct device *dev,
if (ret)
return ret;
- return sprintf(buf, "%llu\n",
- (unsigned long long)rtc_tm_to_time64(&tm));
+ return sysfs_emit(buf, "%llu\n",
+ (unsigned long long)rtc_tm_to_time64(&tm));
};
static DEVICE_ATTR_RW(timestamp0);
@@ -164,7 +164,7 @@ static ssize_t timestamp0_count_show(struct device *dev,
if (ret)
return ret;
- return sprintf(buf, "%u\n", count);
+ return sysfs_emit(buf, "%u\n", count);
};
static DEVICE_ATTR_RO(timestamp0_count);
--
2.56.0.windows.2
reply other threads:[~2026-10-22 8:12 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=20261022081242.421-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®