netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6 5/5]: remove noop_qdisc assignments in destroy functions
@ 2004-08-03 15:25 Patrick McHardy
  2004-08-04 16:47 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick McHardy @ 2004-08-03 15:25 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

[-- Attachment #1: Type: text/plain, Size: 175 bytes --]

This patch removes useless noop_qdisc assignments in multiple qdiscs destroy
functions, the memory where the pointer is stored is freed directly 
after the
destroy function.


[-- Attachment #2: 05-destroy-noop-qdisc.diff --]
[-- Type: text/x-patch, Size: 3007 bytes --]

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/08/03 03:02:03+02:00 kaber@coreworks.de 
#   [PKT_SCHED]: Remove useless noop_qdisc assignments in destroy functions
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
# 
# net/sched/sch_tbf.c
#   2004/08/03 03:01:39+02:00 kaber@coreworks.de +0 -1
#   [PKT_SCHED]: Remove useless noop_qdisc assignments in destroy functions
# 
# net/sched/sch_red.c
#   2004/08/03 03:01:39+02:00 kaber@coreworks.de +0 -5
#   [PKT_SCHED]: Remove useless noop_qdisc assignments in destroy functions
# 
# net/sched/sch_prio.c
#   2004/08/03 03:01:39+02:00 kaber@coreworks.de +1 -3
#   [PKT_SCHED]: Remove useless noop_qdisc assignments in destroy functions
# 
# net/sched/sch_netem.c
#   2004/08/03 03:01:39+02:00 kaber@coreworks.de +0 -2
#   [PKT_SCHED]: Remove useless noop_qdisc assignments in destroy functions
# 
# net/sched/sch_dsmark.c
#   2004/08/03 03:01:39+02:00 kaber@coreworks.de +0 -1
#   [PKT_SCHED]: Remove useless noop_qdisc assignments in destroy functions
# 
diff -Nru a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c
--- a/net/sched/sch_dsmark.c	2004-08-03 03:03:09 +02:00
+++ b/net/sched/sch_dsmark.c	2004-08-03 03:03:09 +02:00
@@ -383,7 +383,6 @@
 		tcf_destroy(tp);
 	}
 	qdisc_destroy(p->q);
-	p->q = &noop_qdisc;
 	kfree(p->mask);
 }
 
diff -Nru a/net/sched/sch_netem.c b/net/sched/sch_netem.c
--- a/net/sched/sch_netem.c	2004-08-03 03:03:09 +02:00
+++ b/net/sched/sch_netem.c	2004-08-03 03:03:09 +02:00
@@ -812,9 +812,7 @@
 	struct netem_sched_data *q = (struct netem_sched_data *)sch->data;
 
 	del_timer_sync(&q->timer);
-
 	qdisc_destroy(q->qdisc);
-	q->qdisc = &noop_qdisc;
 }
 
 static int netem_dump(struct Qdisc *sch, struct sk_buff *skb)
diff -Nru a/net/sched/sch_prio.c b/net/sched/sch_prio.c
--- a/net/sched/sch_prio.c	2004-08-03 03:03:09 +02:00
+++ b/net/sched/sch_prio.c	2004-08-03 03:03:09 +02:00
@@ -208,10 +208,8 @@
 		tcf_destroy(tp);
 	}
 
-	for (prio=0; prio<q->bands; prio++) {
+	for (prio=0; prio<q->bands; prio++)
 		qdisc_destroy(q->queues[prio]);
-		q->queues[prio] = &noop_qdisc;
-	}
 }
 
 static int prio_tune(struct Qdisc *sch, struct rtattr *opt)
diff -Nru a/net/sched/sch_red.c b/net/sched/sch_red.c
--- a/net/sched/sch_red.c	2004-08-03 03:03:09 +02:00
+++ b/net/sched/sch_red.c	2004-08-03 03:03:09 +02:00
@@ -434,10 +434,6 @@
 	return -1;
 }
 
-static void red_destroy(struct Qdisc *sch)
-{
-}
-
 static struct Qdisc_ops red_qdisc_ops = {
 	.next		=	NULL,
 	.cl_ops		=	NULL,
@@ -449,7 +445,6 @@
 	.drop		=	red_drop,
 	.init		=	red_init,
 	.reset		=	red_reset,
-	.destroy	=	red_destroy,
 	.change		=	red_change,
 	.dump		=	red_dump,
 	.owner		=	THIS_MODULE,
diff -Nru a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
--- a/net/sched/sch_tbf.c	2004-08-03 03:03:09 +02:00
+++ b/net/sched/sch_tbf.c	2004-08-03 03:03:09 +02:00
@@ -393,7 +393,6 @@
 		qdisc_put_rtab(q->R_tab);
 
 	qdisc_destroy(q->qdisc);
-	q->qdisc = &noop_qdisc;
 }
 
 static int tbf_dump(struct Qdisc *sch, struct sk_buff *skb)

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

end of thread, other threads:[~2004-08-04 16:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-03 15:25 [PATCH 2.6 5/5]: remove noop_qdisc assignments in destroy functions Patrick McHardy
2004-08-04 16:47 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).