diff options
-rw-r--r-- | kernel/time/timekeeping.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index e960d824263f..49010d822f72 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -710,9 +710,10 @@ static cycle_t logarithmic_accumulation(cycle_t offset, int shift) | |||
710 | /* Accumulate raw time */ | 710 | /* Accumulate raw time */ |
711 | raw_nsecs = timekeeper.raw_interval << shift; | 711 | raw_nsecs = timekeeper.raw_interval << shift; |
712 | raw_nsecs += raw_time.tv_nsec; | 712 | raw_nsecs += raw_time.tv_nsec; |
713 | while (raw_nsecs >= NSEC_PER_SEC) { | 713 | if (raw_nsecs >= NSEC_PER_SEC) { |
714 | raw_nsecs -= NSEC_PER_SEC; | 714 | u64 raw_secs = raw_nsecs; |
715 | raw_time.tv_sec++; | 715 | raw_nsecs = do_div(raw_secs, NSEC_PER_SEC); |
716 | raw_time.tv_sec += raw_secs; | ||
716 | } | 717 | } |
717 | raw_time.tv_nsec = raw_nsecs; | 718 | raw_time.tv_nsec = raw_nsecs; |
718 | 719 | ||