From 0f3bc1c937276458786dc85aaa47142555fe6725 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Thu, 29 Oct 2026 14:23:28 +0100 Subject: [PATCH] rtc: x1205: use sysfs_emit() instead of sprintf() Use sysfs_emit() instead of sprintf() in sysfs show callbacks (x1205_sysfs_show_atrim and x1205_sysfs_show_dtrim) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst. Link: https://patch.msgid.link/20261029132339.925021-5-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-x1205.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-x1205.c b/drivers/rtc/rtc-x1205.c index bb1a5c86f621..6ca6ff45945e 100644 --- a/drivers/rtc/rtc-x1205.c +++ b/drivers/rtc/rtc-x1205.c @@ -575,7 +575,7 @@ static ssize_t x1205_sysfs_show_atrim(struct device *dev, if (err) return err; - return sprintf(buf, "%d.%02d pF\n", atrim / 1000, atrim % 1000); + return sysfs_emit(buf, "%d.%02d pF\n", atrim / 1000, atrim % 1000); } static DEVICE_ATTR(atrim, S_IRUGO, x1205_sysfs_show_atrim, NULL); @@ -588,7 +588,7 @@ static ssize_t x1205_sysfs_show_dtrim(struct device *dev, if (err) return err; - return sprintf(buf, "%d ppm\n", dtrim); + return sysfs_emit(buf, "%d ppm\n", dtrim); } static DEVICE_ATTR(dtrim, S_IRUGO, x1205_sysfs_show_dtrim, NULL);