* [PATCH 02/12] rtc: pcf2127: use sysfs_emit() instead of sprintf()
2026-10-29 13:23 [PATCH 01/12] rtc: rv3029: use sysfs_emit() instead of sprintf() alexandre.belloni
@ 2026-10-29 13:23 ` alexandre.belloni
2026-10-29 13:38 ` sashiko-bot
2026-10-29 18:20 ` Bruno Thomsen
2026-10-29 13:23 ` [PATCH 03/12] rtc: ep93xx: " alexandre.belloni
` (10 subsequent siblings)
11 siblings, 2 replies; 26+ messages in thread
From: alexandre.belloni @ 2026-10-29 13:23 UTC (permalink / raw)
To: Alexandre Belloni; +Cc: linux-rtc, linux-kernel
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
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.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/rtc/rtc-pcf2127.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-pcf2127.c b/drivers/rtc/rtc-pcf2127.c
index ff2023908f5a..49542cc53411 100644
--- a/drivers/rtc/rtc-pcf2127.c
+++ b/drivers/rtc/rtc-pcf2127.c
@@ -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
^ permalink raw reply related [flat|nested] 26+ messages in thread* Re: [PATCH 02/12] rtc: pcf2127: use sysfs_emit() instead of sprintf()
2026-10-29 13:23 ` [PATCH 02/12] rtc: pcf2127: " alexandre.belloni
@ 2026-10-29 13:38 ` sashiko-bot
2026-10-29 18:20 ` Bruno Thomsen
1 sibling, 0 replies; 26+ messages in thread
From: sashiko-bot @ 2026-10-29 13:38 UTC (permalink / raw)
To: alexandre.belloni; +Cc: linux-rtc
> From: Alexandre Belloni <alexandre.belloni@bootlin.com>
>
> 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.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261029132339.925021-1-alexandre.belloni@bootlin.com?part=2
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 02/12] rtc: pcf2127: use sysfs_emit() instead of sprintf()
2026-10-29 13:23 ` [PATCH 02/12] rtc: pcf2127: " alexandre.belloni
2026-10-29 13:38 ` sashiko-bot
@ 2026-10-29 18:20 ` Bruno Thomsen
1 sibling, 0 replies; 26+ messages in thread
From: Bruno Thomsen @ 2026-10-29 18:20 UTC (permalink / raw)
To: alexandre.belloni; +Cc: linux-rtc, linux-kernel
Den tors. 29. okt. 2026 kl. 14.38 skrev <alexandre.belloni@bootlin.com>:
>
> From: Alexandre Belloni <alexandre.belloni@bootlin.com>
>
> 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.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Bruno Thomsen <bruno.thomsen@gmail.com>
> ---
> drivers/rtc/rtc-pcf2127.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/rtc/rtc-pcf2127.c b/drivers/rtc/rtc-pcf2127.c
> index ff2023908f5a..49542cc53411 100644
> --- a/drivers/rtc/rtc-pcf2127.c
> +++ b/drivers/rtc/rtc-pcf2127.c
> @@ -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
>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 03/12] rtc: ep93xx: use sysfs_emit() instead of sprintf()
2026-10-29 13:23 [PATCH 01/12] rtc: rv3029: use sysfs_emit() instead of sprintf() alexandre.belloni
2026-10-29 13:23 ` [PATCH 02/12] rtc: pcf2127: " alexandre.belloni
@ 2026-10-29 13:23 ` alexandre.belloni
2026-10-29 13:38 ` sashiko-bot
2026-10-29 13:23 ` [PATCH 04/12] rtc: bq32k: " alexandre.belloni
` (9 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: alexandre.belloni @ 2026-10-29 13:23 UTC (permalink / raw)
To: Alexandre Belloni; +Cc: linux-rtc, linux-kernel
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
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.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/rtc/rtc-ep93xx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-ep93xx.c b/drivers/rtc/rtc-ep93xx.c
index 507c9f22036c..f105aba28459 100644
--- a/drivers/rtc/rtc-ep93xx.c
+++ b/drivers/rtc/rtc-ep93xx.c
@@ -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);
--
2.56.0
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 04/12] rtc: bq32k: use sysfs_emit() instead of sprintf()
2026-10-29 13:23 [PATCH 01/12] rtc: rv3029: use sysfs_emit() instead of sprintf() alexandre.belloni
2026-10-29 13:23 ` [PATCH 02/12] rtc: pcf2127: " alexandre.belloni
2026-10-29 13:23 ` [PATCH 03/12] rtc: ep93xx: " alexandre.belloni
@ 2026-10-29 13:23 ` alexandre.belloni
2026-10-29 13:40 ` sashiko-bot
2026-10-29 13:23 ` [PATCH 05/12] rtc: x1205: " alexandre.belloni
` (8 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: alexandre.belloni @ 2026-10-29 13:23 UTC (permalink / raw)
To: Alexandre Belloni; +Cc: linux-rtc, linux-kernel
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
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.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/rtc/rtc-bq32k.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-bq32k.c b/drivers/rtc/rtc-bq32k.c
index 573231613e52..0f50cfce88cb 100644
--- a/drivers/rtc/rtc-bq32k.c
+++ b/drivers/rtc/rtc-bq32k.c
@@ -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,
--
2.56.0
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 05/12] rtc: x1205: use sysfs_emit() instead of sprintf()
2026-10-29 13:23 [PATCH 01/12] rtc: rv3029: use sysfs_emit() instead of sprintf() alexandre.belloni
` (2 preceding siblings ...)
2026-10-29 13:23 ` [PATCH 04/12] rtc: bq32k: " alexandre.belloni
@ 2026-10-29 13:23 ` alexandre.belloni
2026-10-29 13:39 ` sashiko-bot
2026-10-29 13:23 ` [PATCH 06/12] rtc: abx80x: " alexandre.belloni
` (7 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: alexandre.belloni @ 2026-10-29 13:23 UTC (permalink / raw)
To: Alexandre Belloni; +Cc: linux-rtc, linux-kernel
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
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.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
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);
--
2.56.0
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 06/12] rtc: abx80x: use sysfs_emit() instead of sprintf()
2026-10-29 13:23 [PATCH 01/12] rtc: rv3029: use sysfs_emit() instead of sprintf() alexandre.belloni
` (3 preceding siblings ...)
2026-10-29 13:23 ` [PATCH 05/12] rtc: x1205: " alexandre.belloni
@ 2026-10-29 13:23 ` alexandre.belloni
2026-10-29 13:38 ` sashiko-bot
2026-10-29 13:23 ` [PATCH 07/12] rtc: rx8025: " alexandre.belloni
` (6 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: alexandre.belloni @ 2026-10-29 13:23 UTC (permalink / raw)
To: Alexandre Belloni; +Cc: linux-rtc, linux-kernel
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
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.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/rtc/rtc-abx80x.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/rtc/rtc-abx80x.c b/drivers/rtc/rtc-abx80x.c
index 1c69d0e2f940..a0d67818eb58 100644
--- a/drivers/rtc/rtc-abx80x.c
+++ b/drivers/rtc/rtc-abx80x.c
@@ -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);
--
2.56.0
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 07/12] rtc: rx8025: use sysfs_emit() instead of sprintf()
2026-10-29 13:23 [PATCH 01/12] rtc: rv3029: use sysfs_emit() instead of sprintf() alexandre.belloni
` (4 preceding siblings ...)
2026-10-29 13:23 ` [PATCH 06/12] rtc: abx80x: " alexandre.belloni
@ 2026-10-29 13:23 ` alexandre.belloni
2026-10-29 13:41 ` sashiko-bot
2026-10-29 13:23 ` [PATCH 08/12] rtc: ds1343: " alexandre.belloni
` (5 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: alexandre.belloni @ 2026-10-29 13:23 UTC (permalink / raw)
To: Alexandre Belloni; +Cc: linux-rtc, linux-kernel
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
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.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/rtc/rtc-rx8025.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-rx8025.c b/drivers/rtc/rtc-rx8025.c
index 2f2deb59cbee..96a04c977d0f 100644
--- a/drivers/rtc/rtc-rx8025.c
+++ b/drivers/rtc/rtc-rx8025.c
@@ -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,
--
2.56.0
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 08/12] rtc: ds1343: use sysfs_emit() instead of sprintf()
2026-10-29 13:23 [PATCH 01/12] rtc: rv3029: use sysfs_emit() instead of sprintf() alexandre.belloni
` (5 preceding siblings ...)
2026-10-29 13:23 ` [PATCH 07/12] rtc: rx8025: " alexandre.belloni
@ 2026-10-29 13:23 ` alexandre.belloni
2026-10-29 13:38 ` sashiko-bot
2026-10-29 13:23 ` [PATCH 09/12] rtc: ds1685: " alexandre.belloni
` (4 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: alexandre.belloni @ 2026-10-29 13:23 UTC (permalink / raw)
To: Alexandre Belloni; +Cc: linux-rtc, linux-kernel
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
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.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
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);
--
2.56.0
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 09/12] rtc: ds1685: use sysfs_emit() instead of sprintf()
2026-10-29 13:23 [PATCH 01/12] rtc: rv3029: use sysfs_emit() instead of sprintf() alexandre.belloni
` (6 preceding siblings ...)
2026-10-29 13:23 ` [PATCH 08/12] rtc: ds1343: " alexandre.belloni
@ 2026-10-29 13:23 ` alexandre.belloni
2026-10-29 13:40 ` sashiko-bot
2026-10-29 13:49 ` Joshua Kinard
2026-10-29 13:23 ` [PATCH 10/12] rtc: isl1208: " alexandre.belloni
` (3 subsequent siblings)
11 siblings, 2 replies; 26+ messages in thread
From: alexandre.belloni @ 2026-10-29 13:23 UTC (permalink / raw)
To: Joshua Kinard, Alexandre Belloni; +Cc: linux-rtc, linux-kernel
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
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.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/rtc/rtc-ds1685.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c
index 284815e5f478..323fc9c17106 100644
--- a/drivers/rtc/rtc-ds1685.c
+++ b/drivers/rtc/rtc-ds1685.c
@@ -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);
--
2.56.0
^ permalink raw reply related [flat|nested] 26+ messages in thread* Re: [PATCH 09/12] rtc: ds1685: use sysfs_emit() instead of sprintf()
2026-10-29 13:23 ` [PATCH 09/12] rtc: ds1685: " alexandre.belloni
@ 2026-10-29 13:40 ` sashiko-bot
2026-10-29 13:49 ` Joshua Kinard
1 sibling, 0 replies; 26+ messages in thread
From: sashiko-bot @ 2026-10-29 13:40 UTC (permalink / raw)
To: alexandre.belloni; +Cc: linux-rtc
> From: Alexandre Belloni <alexandre.belloni@bootlin.com>
>
> 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.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261029132339.925021-1-alexandre.belloni@bootlin.com?part=9
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 09/12] rtc: ds1685: use sysfs_emit() instead of sprintf()
2026-10-29 13:23 ` [PATCH 09/12] rtc: ds1685: " alexandre.belloni
2026-10-29 13:40 ` sashiko-bot
@ 2026-10-29 13:49 ` Joshua Kinard
1 sibling, 0 replies; 26+ messages in thread
From: Joshua Kinard @ 2026-10-29 13:49 UTC (permalink / raw)
To: alexandre.belloni; +Cc: linux-rtc, linux-kernel
On 10/29/2026 09:23, alexandre.belloni@bootlin.com wrote:
> From: Alexandre Belloni <alexandre.belloni@bootlin.com>
>
> 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.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---
> drivers/rtc/rtc-ds1685.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c
> index 284815e5f478..323fc9c17106 100644
> --- a/drivers/rtc/rtc-ds1685.c
> +++ b/drivers/rtc/rtc-ds1685.c
> @@ -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);
>
Acked-by: Joshua Kinard <linux@kumba.dev>
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 10/12] rtc: isl1208: use sysfs_emit() instead of sprintf()
2026-10-29 13:23 [PATCH 01/12] rtc: rv3029: use sysfs_emit() instead of sprintf() alexandre.belloni
` (7 preceding siblings ...)
2026-10-29 13:23 ` [PATCH 09/12] rtc: ds1685: " alexandre.belloni
@ 2026-10-29 13:23 ` alexandre.belloni
2026-10-29 13:39 ` sashiko-bot
2026-10-29 13:23 ` [PATCH 11/12] rtc: ds1307: " alexandre.belloni
` (2 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: alexandre.belloni @ 2026-10-29 13:23 UTC (permalink / raw)
To: Alexandre Belloni; +Cc: linux-rtc, linux-kernel
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
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 11/12] rtc: ds1307: use sysfs_emit() instead of sprintf()
2026-10-29 13:23 [PATCH 01/12] rtc: rv3029: use sysfs_emit() instead of sprintf() alexandre.belloni
` (8 preceding siblings ...)
2026-10-29 13:23 ` [PATCH 10/12] rtc: isl1208: " alexandre.belloni
@ 2026-10-29 13:23 ` alexandre.belloni
2026-10-29 13:39 ` sashiko-bot
2026-10-29 13:23 ` [PATCH 12/12] rtc: rs5c372: " alexandre.belloni
2026-10-29 13:38 ` [PATCH 01/12] rtc: rv3029: " sashiko-bot
11 siblings, 1 reply; 26+ messages in thread
From: alexandre.belloni @ 2026-10-29 13:23 UTC (permalink / raw)
To: Alexandre Belloni; +Cc: linux-rtc, linux-kernel
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
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.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/rtc/rtc-ds1307.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index 8627f84232ce..206a79d28568 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -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);
--
2.56.0
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 12/12] rtc: rs5c372: use sysfs_emit() instead of sprintf()
2026-10-29 13:23 [PATCH 01/12] rtc: rv3029: use sysfs_emit() instead of sprintf() alexandre.belloni
` (9 preceding siblings ...)
2026-10-29 13:23 ` [PATCH 11/12] rtc: ds1307: " alexandre.belloni
@ 2026-10-29 13:23 ` alexandre.belloni
2026-10-29 13:41 ` sashiko-bot
2026-10-29 13:38 ` [PATCH 01/12] rtc: rv3029: " sashiko-bot
11 siblings, 1 reply; 26+ messages in thread
From: alexandre.belloni @ 2026-10-29 13:23 UTC (permalink / raw)
To: Alexandre Belloni; +Cc: linux-rtc, linux-kernel
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
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.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/rtc/rtc-rs5c372.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c
index 9ab6f2c28f7b..a4bd042908b8 100644
--- a/drivers/rtc/rtc-rs5c372.c
+++ b/drivers/rtc/rtc-rs5c372.c
@@ -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);
--
2.56.0
^ permalink raw reply related [flat|nested] 26+ messages in thread* Re: [PATCH 01/12] rtc: rv3029: use sysfs_emit() instead of sprintf()
2026-10-29 13:23 [PATCH 01/12] rtc: rv3029: use sysfs_emit() instead of sprintf() alexandre.belloni
` (10 preceding siblings ...)
2026-10-29 13:23 ` [PATCH 12/12] rtc: rs5c372: " alexandre.belloni
@ 2026-10-29 13:38 ` sashiko-bot
11 siblings, 0 replies; 26+ messages in thread
From: sashiko-bot @ 2026-10-29 13:38 UTC (permalink / raw)
To: alexandre.belloni; +Cc: linux-rtc
> From: Alexandre Belloni <alexandre.belloni@bootlin.com>
>
> 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.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261029132339.925021-1-alexandre.belloni@bootlin.com?part=1
^ permalink raw reply [flat|nested] 26+ messages in thread