net_sched: use setup_deferrable_timer
authorGeliang Tang <geliangtang@gmail.com>
Fri, 24 Mar 2017 14:14:36 +0000 (22:14 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 24 Mar 2017 21:42:52 +0000 (14:42 -0700)
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>
net/sched/cls_flow.c
net/sched/sch_sfq.c

index 3d6b9286c203f298b14b5254e5c12cb4781eb4b1..ca193af8634ad71a80e490c4ce916c4cedfd543f 100644 (file)
@@ -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);
index 42e8c8615e6563a2deabbb3c3437e3985d01ae14..b00e02c139de8d7c0b66ec6ee0d8b6c677529609 100644 (file)
@@ -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;