diff options
author | Patrick McHardy <kaber@trash.net> | 2008-11-20 13:11:36 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-20 13:11:36 +0100 |
commit | b94c8afcba3ae6584653b98e315446ea83be6ea5 (patch) | |
tree | 377fcfaf74e3aa38243c736a440e45b378355d8e /net/sched/sch_red.c | |
parent | isdn: isdn_net.c annotate struct ip_ports and trivial sparse fixes (diff) | |
download | linux-b94c8afcba3ae6584653b98e315446ea83be6ea5.tar.xz linux-b94c8afcba3ae6584653b98e315446ea83be6ea5.zip |
pkt_sched: remove unnecessary xchg() in packet schedulers
The use of xchg() hasn't been necessary since 2.2.something when proper
locking was added to packet schedulers.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_red.c')
-rw-r--r-- | net/sched/sch_red.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c index 6a0371c22643..2bdf241f6315 100644 --- a/net/sched/sch_red.c +++ b/net/sched/sch_red.c @@ -202,7 +202,8 @@ static int red_change(struct Qdisc *sch, struct nlattr *opt) q->limit = ctl->limit; if (child) { qdisc_tree_decrease_qlen(q->qdisc, q->qdisc->q.qlen); - qdisc_destroy(xchg(&q->qdisc, child)); + qdisc_destroy(q->qdisc); + q->qdisc = child; } red_set_parms(&q->parms, ctl->qth_min, ctl->qth_max, ctl->Wlog, @@ -283,7 +284,8 @@ static int red_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new, new = &noop_qdisc; sch_tree_lock(sch); - *old = xchg(&q->qdisc, new); + *old = q->qdisc; + q->qdisc = new; qdisc_tree_decrease_qlen(*old, (*old)->q.qlen); qdisc_reset(*old); sch_tree_unlock(sch); |