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

From: Bruno Thomsen

Date: Thu Oct 29 2026 - 14:26:09 EST


Den tors. 29. okt. 2026 kl. 14.38 skrev <alexandre.belloni@xxxxxxxxxxx>:
>
> From: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
>
> 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@xxxxxxxxxxx>

Reviewed-by: Bruno Thomsen <bruno.thomsen@xxxxxxxxx>

> ---
> 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
>
>