netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6 4/5]: remove unneccessary checks for qdisc->dev
@ 2004-08-03 15:25 Patrick McHardy
  2004-08-04 16:44 ` 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: 82 bytes --]

qdisc->dev is always valid, this patch removes a couple of unneccessary 
checks.


[-- Attachment #2: 04-qdisc-dev-checks.diff --]
[-- Type: text/x-patch, Size: 1630 bytes --]

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/08/03 01:28:36+02:00 kaber@coreworks.de 
#   [PKT_SCHED]: remove unneccessary checks for qdisc->dev
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
# 
# net/sched/sch_generic.c
#   2004/08/03 01:28:15+02:00 kaber@coreworks.de +1 -2
#   [PKT_SCHED]: remove unneccessary checks for qdisc->dev
# 
# net/sched/sch_api.c
#   2004/08/03 01:28:15+02:00 kaber@coreworks.de +2 -2
#   [PKT_SCHED]: remove unneccessary checks for qdisc->dev
# 
diff -Nru a/net/sched/sch_api.c b/net/sched/sch_api.c
--- a/net/sched/sch_api.c	2004-08-03 01:30:00 +02:00
+++ b/net/sched/sch_api.c	2004-08-03 01:30:00 +02:00
@@ -753,7 +753,7 @@
 	nlh->nlmsg_flags = flags;
 	tcm = NLMSG_DATA(nlh);
 	tcm->tcm_family = AF_UNSPEC;
-	tcm->tcm_ifindex = q->dev ? q->dev->ifindex : 0;
+	tcm->tcm_ifindex = q->dev->ifindex;
 	tcm->tcm_parent = clid;
 	tcm->tcm_handle = q->handle;
 	tcm->tcm_info = atomic_read(&q->refcnt);
@@ -970,7 +970,7 @@
 	nlh->nlmsg_flags = flags;
 	tcm = NLMSG_DATA(nlh);
 	tcm->tcm_family = AF_UNSPEC;
-	tcm->tcm_ifindex = q->dev ? q->dev->ifindex : 0;
+	tcm->tcm_ifindex = q->dev->ifindex;
 	tcm->tcm_parent = q->handle;
 	tcm->tcm_handle = q->handle;
 	tcm->tcm_info = 0;
diff -Nru a/net/sched/sch_generic.c b/net/sched/sch_generic.c
--- a/net/sched/sch_generic.c	2004-08-03 01:30:00 +02:00
+++ b/net/sched/sch_generic.c	2004-08-03 01:30:00 +02:00
@@ -443,8 +443,7 @@
 	write_unlock(&qdisc_tree_lock);
 	module_put(ops->owner);
 
-	if (qdisc->dev)
-		dev_put(qdisc->dev);
+	dev_put(qdisc->dev);
 	if (!(qdisc->flags&TCQ_F_BUILTIN))
 		kfree(qdisc);
 }

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

* Re: [PATCH 2.6 4/5]: remove unneccessary checks for qdisc->dev
  2004-08-03 15:25 [PATCH 2.6 4/5]: remove unneccessary checks for qdisc->dev Patrick McHardy
@ 2004-08-04 16:44 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2004-08-04 16:44 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: netdev

On Tue, 03 Aug 2004 17:25:25 +0200
Patrick McHardy <kaber@trash.net> wrote:

> qdisc->dev is always valid, this patch removes a couple of unneccessary 
> checks.

Looks good, applied.

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

end of thread, other threads:[~2004-08-04 16:44 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 4/5]: remove unneccessary checks for qdisc->dev Patrick McHardy
2004-08-04 16:44 ` 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).