From: Patrick McHardy <kaber@trash.net>
To: "David S. Miller" <davem@redhat.com>
Cc: netdev@oss.sgi.com
Subject: [PATCH 2.6 5/5]: remove noop_qdisc assignments in destroy functions
Date: Tue, 03 Aug 2004 17:25:54 +0200 [thread overview]
Message-ID: <410FAE82.7070604@trash.net> (raw)
[-- 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)
next reply other threads:[~2004-08-03 15:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-03 15:25 Patrick McHardy [this message]
2004-08-04 16:47 ` [PATCH 2.6 5/5]: remove noop_qdisc assignments in destroy functions David S. Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=410FAE82.7070604@trash.net \
--to=kaber@trash.net \
--cc=davem@redhat.com \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.