Why is tc_get_timecount() called two times in tc_init()?
Konstantin Belousov
kostikbel at gmail.com
Wed Oct 2 14:00:51 UTC 2019
On Tue, Oct 01, 2019 at 01:11:18PM +0200, Sebastian Huber wrote:
> Hello,
>
> since this commit
>
> https://github.com/freebsd/freebsd/commit/307f787e5a7f
>
It is not very useful to pass github hashes around.
I think that the addition of the second tc_get_timecount() was done
earlier, in r95530, and there it has semi-useful comment
+ /* Warm up new timecounter. */
+ (void)newtc->tc_get_timecount(newtc);
+ (void)newtc->tc_get_timecount(newtc);
The commit message is not helpful at all.
I do not see a timecounter which would need two get_timecount() calls
to start working properly now, but I can imagine that at time it was.
I added Bruce to Cc: to may be get more context and explanation.
> tc_get_timecount() is called two times in tc_init().
>
> /*
> * Initialize a new timecounter and possibly use it.
> */
> void
> tc_init(struct timecounter *tc)
> {
> [...]
> if (tc->tc_quality == timecounter->tc_quality &&
> tc->tc_frequency < timecounter->tc_frequency)
> return;
> (void)tc->tc_get_timecount(tc);
> (void)tc->tc_get_timecount(tc);
> timecounter = tc;
> }
>
> What is the reason for this procedure?
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone : +49 89 189 47 41-16
> Fax : +49 89 189 47 41-09
> E-Mail : sebastian.huber at embedded-brains.de
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
More information about the freebsd-hackers
mailing list