Skip to contentSkip to conversation

rtc: rv3029: use sysfs_emit() instead of sprintf()

PATCH New Akshat Rawat 2 participants 2 messages Oct 30 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: rv3029: use sysfs_emit() instead of sprintf()

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.

---
 drivers/rtc/rtc-rv3029c2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/rtc/rtc-rv3029c2.c +2 -2
index c348b31928e9..33b73bbcaf52 100644
@@ -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,
Signature · 1 line
2.56.0.windows.4
#1 lore raw
Sashiko has reviewed this patch and found no issues.
Quoted 6 lines

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.

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1