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 - 10:59:15 EST
On Tue, Dec 01, 2026 at 04:10:00PM +0100, Alexandre Belloni wrote:
> On 01/12/2026 10:05:36+0100, Thomas Weißschuh (Schneider Electric) wrote:
> > 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.
>
> Was that so urgent that this had to be applied right away?
It's not urgent at all from my side and I wouldn't expect tglx to have
an issue with dropping it from tip again.
On the other hand, as (a functionally equivalent) v1 was sent three months ago
and didn't get any response before now, the assumption that you don't care very
much either way was legitimate in my opinion.
(But I can't speak for tglx's reasoning)
Side-note: Is it intentional that the .tm_yday returned by rtc_time64_to_tm()
differs from the one returned by time64_to_tm()?
Thomas