Skip to contentSkip to conversation

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

PATCH In review [email protected] 5 participants 27 messages Oct 29 – Oct 30

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

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

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in sysfs show callbacks (rv3029_hwmon_show_temp and rv3029_hwmon_show_update_interval) to conform to 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
author maintainer
#1 lore raw

PATCH 2/12 rtc: pcf2127: use sysfs_emit() instead of sprintf()

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in the sysfs show callback (timestamp_show) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst.

---
 drivers/rtc/rtc-pcf2127.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-pcf2127.c +1 -1
index ff2023908f5a..49542cc53411 100644
@@ -972,7 +972,7 @@ static ssize_t timestamp_show(struct device *dev,
 		if (ret)
 			return ret;
 	}
-	return sprintf(buf, "%llu\n", (unsigned long long)ts);
+	return sysfs_emit(buf, "%llu\n", (unsigned long long)ts);
 }
 
 static ssize_t timestamp0_show(struct device *dev,
Signature · 1 line
2.56.0
#2 lore raw

Re: [PATCH 02/12] rtc: pcf2127: use sysfs_emit() instead of sprintf()

Sashiko has reviewed this patch and found no issues.
Quoted 7 lines

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in the sysfs show callback (timestamp_show) to conform to 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=2
Reviewed-by on v1 2/12
#3 lore raw

Re: [PATCH 02/12] rtc: pcf2127: use sysfs_emit() instead of sprintf()

In reply to [email protected]

Den tors. 29. okt. 2026 kl. 14.38 skrev <[email protected]>:

Quoted 8 lines

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in the sysfs show callback (timestamp_show) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst.

Quoted 21 lines
---
 drivers/rtc/rtc-pcf2127.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-pcf2127.c +1 -2
index ff2023908f5a..49542cc53411 100644
@@ -972,7 +972,7 @@ static ssize_t timestamp_show(struct device *dev,
                if (ret)
                        return ret;
        }
-       return sprintf(buf, "%llu\n", (unsigned long long)ts);
+       return sysfs_emit(buf, "%llu\n", (unsigned long long)ts);
 }
 
 static ssize_t timestamp0_show(struct device *dev,
--

2.56.0

author maintainer
#4 lore raw

PATCH 3/12 rtc: ep93xx: use sysfs_emit() instead of sprintf()

In reply to [email protected]

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in sysfs show callbacks (comp_preload_show and comp_delete_show) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst.

---
 drivers/rtc/rtc-ep93xx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/rtc/rtc-ep93xx.c +2 -2
index 507c9f22036c..f105aba28459 100644
@@ -93,7 +93,7 @@ static ssize_t comp_preload_show(struct device *dev,
 
 	ep93xx_rtc_get_swcomp(dev->parent, &preload, NULL);
 
-	return sprintf(buf, "%d\n", preload);
+	return sysfs_emit(buf, "%d\n", preload);
 }
 static DEVICE_ATTR_RO(comp_preload);
 
@@ -104,7 +104,7 @@ static ssize_t comp_delete_show(struct device *dev,
 
 	ep93xx_rtc_get_swcomp(dev->parent, NULL, &delete);
 
-	return sprintf(buf, "%d\n", delete);
+	return sysfs_emit(buf, "%d\n", delete);
 }
 static DEVICE_ATTR_RO(comp_delete);
 
Signature · 1 line
2.56.0
#5 lore raw

Re: [PATCH 03/12] rtc: ep93xx: use sysfs_emit() instead of sprintf()

Sashiko has reviewed this patch and found no issues.
Quoted 8 lines

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in sysfs show callbacks (comp_preload_show and comp_delete_show) to conform to 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=3
author maintainer
#6 lore raw

PATCH 4/12 rtc: bq32k: use sysfs_emit() instead of sprintf()

In reply to [email protected]

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in the sysfs show callback (bq32k_sysfs_show_tricklecharge_bypass) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst.

---
 drivers/rtc/rtc-bq32k.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-bq32k.c +1 -1
index 573231613e52..0f50cfce88cb 100644
@@ -210,7 +210,7 @@ static ssize_t bq32k_sysfs_show_tricklecharge_bypass(struct device *dev,
 	if (error)
 		return error;
 
-	return sprintf(buf, "%d\n", (reg & BQ32K_TCFE) ? 1 : 0);
+	return sysfs_emit(buf, "%d\n", (reg & BQ32K_TCFE) ? 1 : 0);
 }
 
 static ssize_t bq32k_sysfs_store_tricklecharge_bypass(struct device *dev,
Signature · 1 line
2.56.0
#7 lore raw

Re: [PATCH 04/12] rtc: bq32k: use sysfs_emit() instead of sprintf()

Sashiko has reviewed this patch and found no issues.
Quoted 8 lines

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in the sysfs show callback (bq32k_sysfs_show_tricklecharge_bypass) to conform to 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=4
author maintainer
#8 lore raw

PATCH 5/12 rtc: x1205: use sysfs_emit() instead of sprintf()

In reply to [email protected]

From: Alexandre Belloni <[email protected]>

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.

---
 drivers/rtc/rtc-x1205.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/rtc/rtc-x1205.c +2 -2
index bb1a5c86f621..6ca6ff45945e 100644
@@ -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);
 
Signature · 1 line
2.56.0
#9 lore raw

Re: [PATCH 05/12] rtc: x1205: use sysfs_emit() instead of sprintf()

Sashiko has reviewed this patch and found no issues.
Quoted 8 lines

From: Alexandre Belloni <[email protected]>

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.

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
author maintainer
#10 lore raw

PATCH 6/12 rtc: abx80x: use sysfs_emit() instead of sprintf()

In reply to [email protected]

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in sysfs show callbacks (autocalibration_show and oscillator_show) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst.

---
 drivers/rtc/rtc-abx80x.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/rtc/rtc-abx80x.c +5 -5
index 1c69d0e2f940..a0d67818eb58 100644
@@ -442,11 +442,11 @@ static ssize_t autocalibration_show(struct device *dev,
 	autocalibration = abx80x_rtc_get_autocalibration(dev->parent);
 	if (autocalibration < 0) {
 		dev_err(dev, "Failed to read RTC autocalibration\n");
-		sprintf(buf, "0\n");
+		sysfs_emit(buf, "0\n");
 		return autocalibration;
 	}
 
-	return sprintf(buf, "%d\n", autocalibration);
+	return sysfs_emit(buf, "%d\n", autocalibration);
 }
 
 static DEVICE_ATTR_RW(autocalibration);
@@ -490,14 +490,14 @@ static ssize_t oscillator_show(struct device *dev,
 
 	if (rc_mode < 0) {
 		dev_err(dev, "Failed to read RTC oscillator selection\n");
-		sprintf(buf, "\n");
+		sysfs_emit(buf, "\n");
 		return rc_mode;
 	}
 
 	if (rc_mode)
-		return sprintf(buf, "rc\n");
+		return sysfs_emit(buf, "rc\n");
 	else
-		return sprintf(buf, "xtal\n");
+		return sysfs_emit(buf, "xtal\n");
 }
 
 static DEVICE_ATTR_RW(oscillator);
Signature · 1 line
2.56.0
#11 lore raw

Re: [PATCH 06/12] rtc: abx80x: use sysfs_emit() instead of sprintf()

Sashiko has reviewed this patch and found no issues.
Quoted 8 lines

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in sysfs show callbacks (autocalibration_show and oscillator_show) to conform to 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=6
#12 lore raw

Re: [PATCH 06/12] rtc: abx80x: use sysfs_emit() instead of sprintf()

In reply to [email protected]
Quoted 17 lines · On Thu, 29 Oct 2026 14:23:29 +0100 [email protected] wrote:

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in sysfs show callbacks (autocalibration_show and oscillator_show) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst.

---
 drivers/rtc/rtc-abx80x.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/rtc/rtc-abx80x.c +0 -0
index 1c69d0e2f940..a0d67818eb58 100644

drivers/rtc/rtc-abx80x.c static ssize_t autocalibration_show(struct device *dev, · line 446

Quoted 6 lines
drivers/rtc/rtc-abx80x.c +1 -1
@@ -442,11 +442,11 @@ static ssize_t autocalibration_show(struct device *dev,
 	autocalibration = abx80x_rtc_get_autocalibration(dev->parent);
 	if (autocalibration < 0) {
 		dev_err(dev, "Failed to read RTC autocalibration\n");
-		sprintf(buf, "0\n");
+		sysfs_emit(buf, "0\n");
 		return autocalibration;

That doesn't make sense.
The return value is the length of data in the buffer. So there is no point calling sprintf/sysfs_emit and then returning an error.

David

Quoted 25 lines
drivers/rtc/rtc-abx80x.c +4 -4
 	}
 
-	return sprintf(buf, "%d\n", autocalibration);
+	return sysfs_emit(buf, "%d\n", autocalibration);
 }
 
 static DEVICE_ATTR_RW(autocalibration);
@@ -490,14 +490,14 @@ static ssize_t oscillator_show(struct device *dev,
 
 	if (rc_mode < 0) {
 		dev_err(dev, "Failed to read RTC oscillator selection\n");
-		sprintf(buf, "\n");
+		sysfs_emit(buf, "\n");
 		return rc_mode;
 	}
 
 	if (rc_mode)
-		return sprintf(buf, "rc\n");
+		return sysfs_emit(buf, "rc\n");
 	else
-		return sprintf(buf, "xtal\n");
+		return sysfs_emit(buf, "xtal\n");
 }
 
 static DEVICE_ATTR_RW(oscillator);
author maintainer
#13 lore raw

PATCH 7/12 rtc: rx8025: use sysfs_emit() instead of sprintf()

In reply to [email protected]

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in the sysfs show callback (rx8025_sysfs_show_clock_adjust) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst.

---
 drivers/rtc/rtc-rx8025.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-rx8025.c +1 -1
index 2f2deb59cbee..96a04c977d0f 100644
@@ -486,7 +486,7 @@ static ssize_t rx8025_sysfs_show_clock_adjust(struct device *dev,
 	if (err)
 		return err;
 
-	return sprintf(buf, "%ld\n", -adj);
+	return sysfs_emit(buf, "%ld\n", -adj);
 }
 
 static ssize_t rx8025_sysfs_store_clock_adjust(struct device *dev,
Signature · 1 line
2.56.0
#14 lore raw

Re: [PATCH 07/12] rtc: rx8025: use sysfs_emit() instead of sprintf()

Sashiko has reviewed this patch and found no issues.
Quoted 7 lines

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in the sysfs show callback (rx8025_sysfs_show_clock_adjust) to conform to 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=7
author maintainer
#15 lore raw

PATCH 8/12 rtc: ds1343: use sysfs_emit() instead of sprintf()

In reply to [email protected]

From: Alexandre Belloni <[email protected]>

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.

---
 drivers/rtc/rtc-ds1343.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/rtc/rtc-ds1343.c +3 -3
index 22abec4ba656..0ec5eaba6bd4 100644
@@ -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);
Signature · 1 line
2.56.0
#16 lore raw

Re: [PATCH 08/12] rtc: ds1343: use sysfs_emit() instead of sprintf()

Sashiko has reviewed this patch and found no issues.
Quoted 8 lines

From: Alexandre Belloni <[email protected]>

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.

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=8
author maintainer
#17 lore raw

PATCH 9/12 rtc: ds1685: use sysfs_emit() instead of sprintf()

In reply to [email protected]

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in sysfs show callbacks (ds1685_rtc_sysfs_battery_show, ds1685_rtc_sysfs_auxbatt_show and ds1685_rtc_sysfs_serial_show) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst.

---
 drivers/rtc/rtc-ds1685.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/rtc/rtc-ds1685.c +5 -5
index 284815e5f478..323fc9c17106 100644
@@ -988,8 +988,8 @@ ds1685_rtc_sysfs_battery_show(struct device *dev,
 
 	ctrld = rtc->read(rtc, RTC_CTRL_D);
 
-	return sprintf(buf, "%s\n",
-			(ctrld & RTC_CTRL_D_VRT) ? "ok" : "not ok or N/A");
+	return sysfs_emit(buf, "%s\n",
+			  (ctrld & RTC_CTRL_D_VRT) ? "ok" : "not ok or N/A");
 }
 static DEVICE_ATTR(battery, S_IRUGO, ds1685_rtc_sysfs_battery_show, NULL);
 
@@ -1010,8 +1010,8 @@ ds1685_rtc_sysfs_auxbatt_show(struct device *dev,
 	ctrl4a = rtc->read(rtc, RTC_EXT_CTRL_4A);
 	ds1685_rtc_switch_to_bank0(rtc);
 
-	return sprintf(buf, "%s\n",
-			(ctrl4a & RTC_CTRL_4A_VRT2) ? "ok" : "not ok or N/A");
+	return sysfs_emit(buf, "%s\n",
+			  (ctrl4a & RTC_CTRL_4A_VRT2) ? "ok" : "not ok or N/A");
 }
 static DEVICE_ATTR(auxbatt, S_IRUGO, ds1685_rtc_sysfs_auxbatt_show, NULL);
 
@@ -1032,7 +1032,7 @@ ds1685_rtc_sysfs_serial_show(struct device *dev,
 	ds1685_rtc_get_ssn(rtc, ssn);
 	ds1685_rtc_switch_to_bank0(rtc);
 
-	return sprintf(buf, "%8phC\n", ssn);
+	return sysfs_emit(buf, "%8phC\n", ssn);
 }
 static DEVICE_ATTR(serial, S_IRUGO, ds1685_rtc_sysfs_serial_show, NULL);
 
Signature · 1 line
2.56.0
#18 lore raw

Re: [PATCH 09/12] rtc: ds1685: use sysfs_emit() instead of sprintf()

Sashiko has reviewed this patch and found no issues.
Quoted 9 lines

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in sysfs show callbacks (ds1685_rtc_sysfs_battery_show, ds1685_rtc_sysfs_auxbatt_show and ds1685_rtc_sysfs_serial_show) to conform to 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=9
maintainer Acked-by on v1 9/12
#19 lore raw

Re: [PATCH 09/12] rtc: ds1685: use sysfs_emit() instead of sprintf()

In reply to [email protected]
Quoted 40 lines · On 10/29/2026 09:23, [email protected] wrote:

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in sysfs show callbacks (ds1685_rtc_sysfs_battery_show, ds1685_rtc_sysfs_auxbatt_show and ds1685_rtc_sysfs_serial_show) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst.

---
  drivers/rtc/rtc-ds1685.c | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)
drivers/rtc/rtc-ds1685.c +4 -4
index 284815e5f478..323fc9c17106 100644
@@ -988,8 +988,8 @@ ds1685_rtc_sysfs_battery_show(struct device *dev,
 
  	ctrld = rtc->read(rtc, RTC_CTRL_D);
 
-	return sprintf(buf, "%s\n",
-			(ctrld & RTC_CTRL_D_VRT) ? "ok" : "not ok or N/A");
+	return sysfs_emit(buf, "%s\n",
+			  (ctrld & RTC_CTRL_D_VRT) ? "ok" : "not ok or N/A");
  }
  static DEVICE_ATTR(battery, S_IRUGO, ds1685_rtc_sysfs_battery_show, NULL);
 
@@ -1010,8 +1010,8 @@ ds1685_rtc_sysfs_auxbatt_show(struct device *dev,
  	ctrl4a = rtc->read(rtc, RTC_EXT_CTRL_4A);
  	ds1685_rtc_switch_to_bank0(rtc);
 
-	return sprintf(buf, "%s\n",
-			(ctrl4a & RTC_CTRL_4A_VRT2) ? "ok" : "not ok or N/A");
+	return sysfs_emit(buf, "%s\n",
+			  (ctrl4a & RTC_CTRL_4A_VRT2) ? "ok" : "not ok or N/A");
  }
  static DEVICE_ATTR(auxbatt, S_IRUGO, ds1685_rtc_sysfs_auxbatt_show, NULL);
 

drivers/rtc/rtc-ds1685.c ds1685_rtc_sysfs_serial_show(struct device *dev, · line 1038

Quoted 8 lines
drivers/rtc/rtc-ds1685.c +1 -1
@@ -1032,7 +1032,7 @@ ds1685_rtc_sysfs_serial_show(struct device *dev,
  	ds1685_rtc_get_ssn(rtc, ssn);
  	ds1685_rtc_switch_to_bank0(rtc);
 
-	return sprintf(buf, "%8phC\n", ssn);
+	return sysfs_emit(buf, "%8phC\n", ssn);
  }
  static DEVICE_ATTR(serial, S_IRUGO, ds1685_rtc_sysfs_serial_show, NULL);
 
author maintainer
#20 lore raw

PATCH 10/12 rtc: isl1208: use sysfs_emit() instead of sprintf()

In reply to [email protected]

From: Alexandre Belloni <[email protected]>

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.

---
 drivers/rtc/rtc-isl1208.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/rtc/rtc-isl1208.c +5 -5
index 9bdd5d121571..ee2eb8c475ea 100644
@@ -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
Signature · 1 line
2.56.0
#21 lore raw

Re: [PATCH 10/12] rtc: isl1208: use sysfs_emit() instead of sprintf()

Sashiko has reviewed this patch and found no issues.
Quoted 9 lines

From: Alexandre Belloni <[email protected]>

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.

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=10
author maintainer
#22 lore raw

PATCH 11/12 rtc: ds1307: use sysfs_emit() instead of sprintf()

In reply to [email protected]

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in the sysfs show callback (ds3231_hwmon_show_temp) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst.

---
 drivers/rtc/rtc-ds1307.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-ds1307.c +1 -1
index 8627f84232ce..206a79d28568 100644
@@ -1380,7 +1380,7 @@ static ssize_t ds3231_hwmon_show_temp(struct device *dev,
 	if (ret)
 		return ret;
 
-	return sprintf(buf, "%d\n", temp);
+	return sysfs_emit(buf, "%d\n", temp);
 }
 static SENSOR_DEVICE_ATTR(temp1_input, 0444, ds3231_hwmon_show_temp,
 			  NULL, 0);
Signature · 1 line
2.56.0
#23 lore raw

Re: [PATCH 11/12] rtc: ds1307: use sysfs_emit() instead of sprintf()

Sashiko has reviewed this patch and found no issues.
Quoted 7 lines

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in the sysfs show callback (ds3231_hwmon_show_temp) to conform to 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=11
author maintainer
#24 lore raw

PATCH 12/12 rtc: rs5c372: use sysfs_emit() instead of sprintf()

In reply to [email protected]

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in sysfs show callbacks (rs5c372_sysfs_show_trim and rs5c372_sysfs_show_osc) to conform to the recommended sysfs attribute formatting guidelines in Documentation/filesystems/sysfs.rst.

---
 drivers/rtc/rtc-rs5c372.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/rtc/rtc-rs5c372.c +2 -2
index 9ab6f2c28f7b..a4bd042908b8 100644
@@ -699,7 +699,7 @@ static ssize_t rs5c372_sysfs_show_trim(struct device *dev,
 	if (err)
 		return err;
 
-	return sprintf(buf, "%d\n", trim);
+	return sysfs_emit(buf, "%d\n", trim);
 }
 static DEVICE_ATTR(trim, S_IRUGO, rs5c372_sysfs_show_trim, NULL);
 
@@ -712,7 +712,7 @@ static ssize_t rs5c372_sysfs_show_osc(struct device *dev,
 	if (err)
 		return err;
 
-	return sprintf(buf, "%d.%03d KHz\n", osc / 1000, osc % 1000);
+	return sysfs_emit(buf, "%d.%03d KHz\n", osc / 1000, osc % 1000);
 }
 static DEVICE_ATTR(osc, S_IRUGO, rs5c372_sysfs_show_osc, NULL);
 
Signature · 1 line
2.56.0
#25 lore raw

Re: [PATCH 12/12] rtc: rs5c372: use sysfs_emit() instead of sprintf()

Sashiko has reviewed this patch and found no issues.
Quoted 8 lines

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in sysfs show callbacks (rs5c372_sysfs_show_trim and rs5c372_sysfs_show_osc) to conform to 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=12
#26 lore raw
In reply to [email protected]
Sashiko has reviewed this patch and found no issues.
Quoted 8 lines

From: Alexandre Belloni <[email protected]>

Use sysfs_emit() instead of sprintf() in sysfs show callbacks (rv3029_hwmon_show_temp and rv3029_hwmon_show_update_interval) to conform to 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