mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: alexandre.belloni@bootlin.com
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 10/12] rtc: isl1208: use sysfs_emit() instead of sprintf()
Date: Thu, 29 Oct 2026 14:23:33 +0100	[thread overview]
Message-ID: <20261029132339.925021-10-alexandre.belloni@bootlin.com> (raw)
In-Reply-To: <20261029132339.925021-1-alexandre.belloni@bootlin.com>

From: Alexandre Belloni <alexandre.belloni@bootlin.com>

Use sysfs_emit() instead of sprintf() in sysfs show callbacks
(timestamp0_show, isl1208_sysfs_show_atrim, isl1208_sysfs_show_dtrim
and isl1208_sysfs_show_usr) to conform to the recommended sysfs
attribute formatting guidelines in
Documentation/filesystems/sysfs.rst.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-isl1208.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c
index 9bdd5d121571..ee2eb8c475ea 100644
--- a/drivers/rtc/rtc-isl1208.c
+++ b/drivers/rtc/rtc-isl1208.c
@@ -615,8 +615,8 @@ static ssize_t timestamp0_show(struct device *dev,
 	if (sr)
 		return sr;
 
-	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);
@@ -709,7 +709,7 @@ isl1208_sysfs_show_atrim(struct device *dev,
 	if (atr < 0)
 		return atr;
 
-	return sprintf(buf, "%d.%.2d pF\n", atr >> 2, (atr & 0x3) * 25);
+	return sysfs_emit(buf, "%d.%.2d pF\n", atr >> 2, (atr & 0x3) * 25);
 }
 
 static DEVICE_ATTR(atrim, S_IRUGO, isl1208_sysfs_show_atrim, NULL);
@@ -722,7 +722,7 @@ isl1208_sysfs_show_dtrim(struct device *dev,
 	if (dtr < 0)
 		return dtr;
 
-	return sprintf(buf, "%d ppm\n", dtr - 100);
+	return sysfs_emit(buf, "%d ppm\n", dtr - 100);
 }
 
 static DEVICE_ATTR(dtrim, S_IRUGO, isl1208_sysfs_show_dtrim, NULL);
@@ -735,7 +735,7 @@ isl1208_sysfs_show_usr(struct device *dev,
 	if (usr < 0)
 		return usr;
 
-	return sprintf(buf, "0x%.4x\n", usr);
+	return sysfs_emit(buf, "0x%.4x\n", usr);
 }
 
 static ssize_t
-- 
2.56.0


  parent reply	other threads:[~2026-10-29 13:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29 13:23 [PATCH 01/12] rtc: rv3029: " alexandre.belloni
2026-10-29 13:23 ` [PATCH 02/12] rtc: pcf2127: " alexandre.belloni
2026-10-29 18:20   ` Bruno Thomsen
2026-10-29 13:23 ` [PATCH 03/12] rtc: ep93xx: " alexandre.belloni
2026-10-29 13:23 ` [PATCH 04/12] rtc: bq32k: " alexandre.belloni
2026-10-29 13:23 ` [PATCH 05/12] rtc: x1205: " alexandre.belloni
2026-10-29 13:23 ` [PATCH 06/12] rtc: abx80x: " alexandre.belloni
2026-10-29 13:23 ` [PATCH 07/12] rtc: rx8025: " alexandre.belloni
2026-10-29 13:23 ` [PATCH 08/12] rtc: ds1343: " alexandre.belloni
2026-10-29 13:23 ` [PATCH 09/12] rtc: ds1685: " alexandre.belloni
2026-10-29 13:49   ` Joshua Kinard
2026-10-29 13:23 ` alexandre.belloni [this message]
2026-10-29 13:23 ` [PATCH 11/12] rtc: ds1307: " alexandre.belloni
2026-10-29 13:23 ` [PATCH 12/12] rtc: rs5c372: " alexandre.belloni

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=20261029132339.925021-10-alexandre.belloni@bootlin.com \
    --to=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®