static void ntp_update_offset(long offset)
{
- s64 freq_adj;
- s64 offset64;
- long secs;
+ s64 freq_adj, offset64;
+ long secs, real_secs;
if (!(time_status & STA_PLL))
return;
* Select how the frequency is to be controlled
* and in which mode (PLL or FLL).
*/
- secs = (long)(__ktime_get_real_seconds() - time_reftime);
+ real_secs = __ktime_get_real_seconds();
+ secs = (long)(real_secs - time_reftime);
if (unlikely(time_status & STA_FREQHOLD))
secs = 0;
- time_reftime = __ktime_get_real_seconds();
+ time_reftime = real_secs;
offset64 = offset;
freq_adj = ntp_update_offset_fll(offset64, secs);