Re: [PATCH v3 3/4] rtc: lib: Implement rtc_time64_to_tm() in terms of time64_to_tm()
From: Thomas Weißschuh (Schneider Electric)
Date: Tue Dec 01 2026 - 04:05:45 EST
On Mon, Nov 30, 2026 at 09:22:32PM +0100, Alexandre Belloni wrote:
> On 30/11/2026 15:20:49+0100, Thomas Weißschuh (Schneider Electric) wrote:
> > The core timekeeping code already provides a function to convert seconds
> > since the epoch to a 'struct tm'. This can be reused for a the
> > 'struct rtc_time' conversion.
> >
> > time64_to_tm() can handle a larger range of dates. It is also
> > 20% slower, but this function is not a hot-path anyways.
> > On the other hand this saves ~600 bytes of .text.
> >
>
> While not in the hot path, this is actually time sensitive which is why
> I always hesitated doing this change.
time64_to_tm() has been optimized by Cassio recently.
So the absolute performance should be much better than the original
rtc_time64_to_tm().
> I guess I'll apply both RTC patches in my tree.
The full series has already been picked up through the tip tree.
> > Signed-off-by: Thomas Weißschuh (Schneider Electric) <thomas.weissschuh@xxxxxxxxxxxxx>
> > Reviewed-by: Cassio Neri <cassio.neri@xxxxxxxxx>
> > ---
> > drivers/rtc/lib.c | 117 +++++++-----------------------------------------------
> > 1 file changed, 15 insertions(+), 102 deletions(-)
(...)