tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Portability fix in kern_ntptime.c



    Date:        Wed, 5 Jun 2019 22:25:39 +0200
    From:        Kamil Rytarowski <n54%gmx.com@localhost>
    Message-ID:  <05d25ffa-588b-464f-56c9-099fea3f3329%gmx.com@localhost>

  | Does this patch look good?

Personally, I would hesitate to change any of the NTP related
code without an extremely good reason, and without a lot of
testing first (in all kinds of conditions).

Further, I'd never do it without a thorough review of the code,
if you looked, you'd also see

                freq = (ntv->freq * 1000LL) >> 16;

and

        ntv->ppsfreq = L_GINT((pps_freq / 1000LL) << 16);

(and perhaps more) - if one of those is a shift of a negative number,
the others potentially are as well (not that shifts of negative numbers
bother me at all if the code author understood what is happening, which
I suspect that they did here.)

kre



Home | Main Index | Thread Index | Old Index