Commit 46baac38 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

pkt_sched: use ns_to_ktime() helper

ns_to_ktime() seems better than ktime_set() + ktime_add_ns()
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 47c1b7b9
...@@ -495,16 +495,15 @@ EXPORT_SYMBOL(qdisc_watchdog_init); ...@@ -495,16 +495,15 @@ EXPORT_SYMBOL(qdisc_watchdog_init);
void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, psched_time_t expires) void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, psched_time_t expires)
{ {
ktime_t time;
if (test_bit(__QDISC_STATE_DEACTIVATED, if (test_bit(__QDISC_STATE_DEACTIVATED,
&qdisc_root_sleeping(wd->qdisc)->state)) &qdisc_root_sleeping(wd->qdisc)->state))
return; return;
qdisc_throttled(wd->qdisc); qdisc_throttled(wd->qdisc);
time = ktime_set(0, 0);
time = ktime_add_ns(time, PSCHED_TICKS2NS(expires)); hrtimer_start(&wd->timer,
hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS); ns_to_ktime(PSCHED_TICKS2NS(expires)),
HRTIMER_MODE_ABS);
} }
EXPORT_SYMBOL(qdisc_watchdog_schedule); EXPORT_SYMBOL(qdisc_watchdog_schedule);
......
...@@ -509,8 +509,7 @@ static void cbq_ovl_delay(struct cbq_class *cl) ...@@ -509,8 +509,7 @@ static void cbq_ovl_delay(struct cbq_class *cl)
cl->cpriority = TC_CBQ_MAXPRIO; cl->cpriority = TC_CBQ_MAXPRIO;
q->pmask |= (1<<TC_CBQ_MAXPRIO); q->pmask |= (1<<TC_CBQ_MAXPRIO);
expires = ktime_set(0, 0); expires = ns_to_ktime(PSCHED_TICKS2NS(sched));
expires = ktime_add_ns(expires, PSCHED_TICKS2NS(sched));
if (hrtimer_try_to_cancel(&q->delay_timer) && if (hrtimer_try_to_cancel(&q->delay_timer) &&
ktime_to_ns(ktime_sub( ktime_to_ns(ktime_sub(
hrtimer_get_expires(&q->delay_timer), hrtimer_get_expires(&q->delay_timer),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment