From 67b3eadfb80dee4dfd56ca624f33e2ac7ed5987a Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Thu, 29 Oct 2026 14:23:31 +0100 Subject: [PATCH] rtc: ds1343: use sysfs_emit() instead of sprintf() Use sysfs_emit() instead of sprintf() in sysfs show callbacks (ds1343_show_glitchfilter and ds1343_show_tricklecharger) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst. Link: https://patch.msgid.link/20261029132339.925021-8-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-ds1343.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/rtc/rtc-ds1343.c b/drivers/rtc/rtc-ds1343.c index 22abec4ba656..0ec5eaba6bd4 100644 --- a/drivers/rtc/rtc-ds1343.c +++ b/drivers/rtc/rtc-ds1343.c @@ -94,9 +94,9 @@ static ssize_t ds1343_show_glitchfilter(struct device *dev, glitch_filt_status = !!(data & DS1343_EGFIL); if (glitch_filt_status) - return sprintf(buf, "enabled\n"); + return sysfs_emit(buf, "enabled\n"); else - return sprintf(buf, "disabled\n"); + return sysfs_emit(buf, "disabled\n"); } static ssize_t ds1343_store_glitchfilter(struct device *dev, @@ -180,7 +180,7 @@ static ssize_t ds1343_show_tricklecharger(struct device *dev, } } - return sprintf(buf, "%s %s\n", diodes, resistors); + return sysfs_emit(buf, "%s %s\n", diodes, resistors); } static DEVICE_ATTR(trickle_charger, 0444, ds1343_show_tricklecharger, NULL);