All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net_sched: use setup_deferrable_timer
@ 2017-03-24 14:14 Geliang Tang
  2017-03-24 21:43 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Geliang Tang @ 2017-03-24 14:14 UTC (permalink / raw)
  To: Jamal Hadi Salim, David S. Miller; +Cc: Geliang Tang, netdev, linux-kernel

Use setup_deferrable_timer() instead of init_timer_deferrable() to
simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 net/sched/cls_flow.c | 5 ++---
 net/sched/sch_sfq.c  | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c
index 3d6b928..ca193af 100644
--- a/net/sched/cls_flow.c
+++ b/net/sched/cls_flow.c
@@ -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);
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
index 9b0911c..332d94b 100644
--- a/net/sched/sch_sfq.c
+++ b/net/sched/sch_sfq.c
@@ -710,9 +710,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;
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net_sched: use setup_deferrable_timer
  2017-03-24 14:14 [PATCH] net_sched: use setup_deferrable_timer Geliang Tang
@ 2017-03-24 21:43 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-03-24 21:43 UTC (permalink / raw)
  To: geliangtang; +Cc: jhs, netdev, linux-kernel

From: Geliang Tang <geliangtang@gmail.com>
Date: Fri, 24 Mar 2017 22:14:36 +0800

> Use setup_deferrable_timer() instead of init_timer_deferrable() to
> simplify the code.
> 
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-24 21:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-24 14:14 [PATCH] net_sched: use setup_deferrable_timer Geliang Tang
2017-03-24 21:43 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.