Skip to content

Commit

Permalink
net_sched: use setup_deferrable_timer
Browse files Browse the repository at this point in the history
Use setup_deferrable_timer() instead of init_timer_deferrable() to
simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Geliang Tang authored and David S. Miller committed Mar 24, 2017
1 parent ff41c7f commit 3b1af93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions net/sched/cls_flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,8 @@ static int flow_change(struct net *net, struct sk_buff *in_skb,
get_random_bytes(&fnew->hashrnd, 4);
}

fnew->perturb_timer.function = flow_perturbation;
fnew->perturb_timer.data = (unsigned long)fnew;
init_timer_deferrable(&fnew->perturb_timer);
setup_deferrable_timer(&fnew->perturb_timer, flow_perturbation,
(unsigned long)fnew);

tcf_exts_change(tp, &fnew->exts, &e);
tcf_em_tree_change(tp, &fnew->ematches, &t);
Expand Down
5 changes: 2 additions & 3 deletions net/sched/sch_sfq.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,9 +714,8 @@ static int sfq_init(struct Qdisc *sch, struct nlattr *opt)
struct sfq_sched_data *q = qdisc_priv(sch);
int i;

q->perturb_timer.function = sfq_perturbation;
q->perturb_timer.data = (unsigned long)sch;
init_timer_deferrable(&q->perturb_timer);
setup_deferrable_timer(&q->perturb_timer, sfq_perturbation,
(unsigned long)sch);

for (i = 0; i < SFQ_MAX_DEPTH + 1; i++) {
q->dep[i].next = i + SFQ_MAX_FLOWS;
Expand Down

0 comments on commit 3b1af93

Please sign in to comment.