dde_linux: fix calculation of ktime from jiffies

This commit is contained in:
Christian Helmuth 2019-01-30 13:59:46 +01:00 committed by Norman Feske
parent 47c6377ac0
commit bcef3aeb1e
2 changed files with 2 additions and 2 deletions

View File

@ -56,7 +56,7 @@ void hrtimer_init(struct hrtimer *timer, clockid_t clock_id, enum hrtimer_mode m
int hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
unsigned long delta_ns, const enum hrtimer_mode mode)
{
unsigned long expires = tim / (NSEC_PER_MSEC * HZ);
unsigned long expires = tim / ((1000/HZ) * NSEC_PER_MSEC);
/*
* Prevent truncation through rounding the values by adding 1 jiffy

View File

@ -80,7 +80,7 @@ static inline ktime_t ktime_add_ms(const ktime_t kt, const u64 msec)
static inline ktime_t ktime_get(void)
{
return (ktime_t){ (s64)jiffies * HZ * NSEC_PER_MSEC /* ns */ };
return (ktime_t){ (s64)jiffies * (1000/HZ) * NSEC_PER_MSEC /* ns */ };
}
static inline ktime_t ktime_set(const long sec, const unsigned long nsec)