net_sched: remove the unused parameter of qdisc_create_dflt()

The first parameter dev isn't in use in qdisc_create_dflt().

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Acked-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Changli Gao 2010-10-16 13:04:08 +00:00 committed by David S. Miller
parent 26d8ee75e0
commit 3511c9132f
13 changed files with 28 additions and 41 deletions

View File

@ -328,8 +328,7 @@ extern void qdisc_destroy(struct Qdisc *qdisc);
extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n); extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n);
extern struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue, extern struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
struct Qdisc_ops *ops); struct Qdisc_ops *ops);
extern struct Qdisc *qdisc_create_dflt(struct net_device *dev, extern struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue,
struct netdev_queue *dev_queue,
struct Qdisc_ops *ops, u32 parentid); struct Qdisc_ops *ops, u32 parentid);
extern void qdisc_calculate_pkt_len(struct sk_buff *skb, extern void qdisc_calculate_pkt_len(struct sk_buff *skb,
struct qdisc_size_table *stab); struct qdisc_size_table *stab);

View File

@ -275,8 +275,7 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent,
goto err_out; goto err_out;
} }
flow->filter_list = NULL; flow->filter_list = NULL;
flow->q = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, flow->q = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops, classid);
&pfifo_qdisc_ops, classid);
if (!flow->q) if (!flow->q)
flow->q = &noop_qdisc; flow->q = &noop_qdisc;
pr_debug("atm_tc_change: qdisc %p\n", flow->q); pr_debug("atm_tc_change: qdisc %p\n", flow->q);
@ -543,7 +542,7 @@ static int atm_tc_init(struct Qdisc *sch, struct nlattr *opt)
INIT_LIST_HEAD(&p->flows); INIT_LIST_HEAD(&p->flows);
INIT_LIST_HEAD(&p->link.list); INIT_LIST_HEAD(&p->link.list);
list_add(&p->link.list, &p->flows); list_add(&p->link.list, &p->flows);
p->link.q = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, p->link.q = qdisc_create_dflt(sch->dev_queue,
&pfifo_qdisc_ops, sch->handle); &pfifo_qdisc_ops, sch->handle);
if (!p->link.q) if (!p->link.q)
p->link.q = &noop_qdisc; p->link.q = &noop_qdisc;

View File

@ -1379,9 +1379,9 @@ static int cbq_init(struct Qdisc *sch, struct nlattr *opt)
q->link.sibling = &q->link; q->link.sibling = &q->link;
q->link.common.classid = sch->handle; q->link.common.classid = sch->handle;
q->link.qdisc = sch; q->link.qdisc = sch;
if (!(q->link.q = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, q->link.q = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops,
&pfifo_qdisc_ops, sch->handle);
sch->handle))) if (!q->link.q)
q->link.q = &noop_qdisc; q->link.q = &noop_qdisc;
q->link.priority = TC_CBQ_MAXPRIO-1; q->link.priority = TC_CBQ_MAXPRIO-1;
@ -1623,7 +1623,7 @@ static int cbq_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
struct cbq_class *cl = (struct cbq_class*)arg; struct cbq_class *cl = (struct cbq_class*)arg;
if (new == NULL) { if (new == NULL) {
new = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, new = qdisc_create_dflt(sch->dev_queue,
&pfifo_qdisc_ops, cl->common.classid); &pfifo_qdisc_ops, cl->common.classid);
if (new == NULL) if (new == NULL)
return -ENOBUFS; return -ENOBUFS;
@ -1874,8 +1874,8 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t
cl->R_tab = rtab; cl->R_tab = rtab;
rtab = NULL; rtab = NULL;
cl->refcnt = 1; cl->refcnt = 1;
if (!(cl->q = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, cl->q = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops, classid);
&pfifo_qdisc_ops, classid))) if (!cl->q)
cl->q = &noop_qdisc; cl->q = &noop_qdisc;
cl->common.classid = classid; cl->common.classid = classid;
cl->tparent = parent; cl->tparent = parent;

View File

@ -110,7 +110,7 @@ static int drr_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
cl->refcnt = 1; cl->refcnt = 1;
cl->common.classid = classid; cl->common.classid = classid;
cl->quantum = quantum; cl->quantum = quantum;
cl->qdisc = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, cl->qdisc = qdisc_create_dflt(sch->dev_queue,
&pfifo_qdisc_ops, classid); &pfifo_qdisc_ops, classid);
if (cl->qdisc == NULL) if (cl->qdisc == NULL)
cl->qdisc = &noop_qdisc; cl->qdisc = &noop_qdisc;
@ -218,7 +218,7 @@ static int drr_graft_class(struct Qdisc *sch, unsigned long arg,
struct drr_class *cl = (struct drr_class *)arg; struct drr_class *cl = (struct drr_class *)arg;
if (new == NULL) { if (new == NULL) {
new = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, new = qdisc_create_dflt(sch->dev_queue,
&pfifo_qdisc_ops, cl->common.classid); &pfifo_qdisc_ops, cl->common.classid);
if (new == NULL) if (new == NULL)
new = &noop_qdisc; new = &noop_qdisc;

View File

@ -61,8 +61,7 @@ static int dsmark_graft(struct Qdisc *sch, unsigned long arg,
sch, p, new, old); sch, p, new, old);
if (new == NULL) { if (new == NULL) {
new = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, new = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops,
&pfifo_qdisc_ops,
sch->handle); sch->handle);
if (new == NULL) if (new == NULL)
new = &noop_qdisc; new = &noop_qdisc;
@ -384,8 +383,7 @@ static int dsmark_init(struct Qdisc *sch, struct nlattr *opt)
p->default_index = default_index; p->default_index = default_index;
p->set_tc_index = nla_get_flag(tb[TCA_DSMARK_SET_TC_INDEX]); p->set_tc_index = nla_get_flag(tb[TCA_DSMARK_SET_TC_INDEX]);
p->q = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, p->q = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops, sch->handle);
&pfifo_qdisc_ops, sch->handle);
if (p->q == NULL) if (p->q == NULL)
p->q = &noop_qdisc; p->q = &noop_qdisc;

View File

@ -172,8 +172,7 @@ struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops,
struct Qdisc *q; struct Qdisc *q;
int err = -ENOMEM; int err = -ENOMEM;
q = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, q = qdisc_create_dflt(sch->dev_queue, ops, TC_H_MAKE(sch->handle, 1));
ops, TC_H_MAKE(sch->handle, 1));
if (q) { if (q) {
err = fifo_set_limit(q, limit); err = fifo_set_limit(q, limit);
if (err < 0) { if (err < 0) {

View File

@ -576,10 +576,8 @@ errout:
return ERR_PTR(err); return ERR_PTR(err);
} }
struct Qdisc * qdisc_create_dflt(struct net_device *dev, struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue,
struct netdev_queue *dev_queue, struct Qdisc_ops *ops, unsigned int parentid)
struct Qdisc_ops *ops,
unsigned int parentid)
{ {
struct Qdisc *sch; struct Qdisc *sch;
@ -684,7 +682,7 @@ static void attach_one_default_qdisc(struct net_device *dev,
struct Qdisc *qdisc; struct Qdisc *qdisc;
if (dev->tx_queue_len) { if (dev->tx_queue_len) {
qdisc = qdisc_create_dflt(dev, dev_queue, qdisc = qdisc_create_dflt(dev_queue,
&pfifo_fast_ops, TC_H_ROOT); &pfifo_fast_ops, TC_H_ROOT);
if (!qdisc) { if (!qdisc) {
printk(KERN_INFO "%s: activation failed\n", dev->name); printk(KERN_INFO "%s: activation failed\n", dev->name);
@ -711,7 +709,7 @@ static void attach_default_qdiscs(struct net_device *dev)
dev->qdisc = txq->qdisc_sleeping; dev->qdisc = txq->qdisc_sleeping;
atomic_inc(&dev->qdisc->refcnt); atomic_inc(&dev->qdisc->refcnt);
} else { } else {
qdisc = qdisc_create_dflt(dev, txq, &mq_qdisc_ops, TC_H_ROOT); qdisc = qdisc_create_dflt(txq, &mq_qdisc_ops, TC_H_ROOT);
if (qdisc) { if (qdisc) {
qdisc->ops->attach(qdisc); qdisc->ops->attach(qdisc);
dev->qdisc = qdisc; dev->qdisc = qdisc;

View File

@ -1088,7 +1088,7 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
cl->refcnt = 1; cl->refcnt = 1;
cl->sched = q; cl->sched = q;
cl->cl_parent = parent; cl->cl_parent = parent;
cl->qdisc = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, cl->qdisc = qdisc_create_dflt(sch->dev_queue,
&pfifo_qdisc_ops, classid); &pfifo_qdisc_ops, classid);
if (cl->qdisc == NULL) if (cl->qdisc == NULL)
cl->qdisc = &noop_qdisc; cl->qdisc = &noop_qdisc;
@ -1209,8 +1209,7 @@ hfsc_graft_class(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
if (cl->level > 0) if (cl->level > 0)
return -EINVAL; return -EINVAL;
if (new == NULL) { if (new == NULL) {
new = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, new = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops,
&pfifo_qdisc_ops,
cl->cl_common.classid); cl->cl_common.classid);
if (new == NULL) if (new == NULL)
new = &noop_qdisc; new = &noop_qdisc;
@ -1452,8 +1451,7 @@ hfsc_init_qdisc(struct Qdisc *sch, struct nlattr *opt)
q->root.cl_common.classid = sch->handle; q->root.cl_common.classid = sch->handle;
q->root.refcnt = 1; q->root.refcnt = 1;
q->root.sched = q; q->root.sched = q;
q->root.qdisc = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, q->root.qdisc = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops,
&pfifo_qdisc_ops,
sch->handle); sch->handle);
if (q->root.qdisc == NULL) if (q->root.qdisc == NULL)
q->root.qdisc = &noop_qdisc; q->root.qdisc = &noop_qdisc;

View File

@ -1121,8 +1121,7 @@ static int htb_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
if (cl->level) if (cl->level)
return -EINVAL; return -EINVAL;
if (new == NULL && if (new == NULL &&
(new = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, (new = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops,
&pfifo_qdisc_ops,
cl->common.classid)) == NULL) cl->common.classid)) == NULL)
return -ENOBUFS; return -ENOBUFS;
@ -1247,8 +1246,7 @@ static int htb_delete(struct Qdisc *sch, unsigned long arg)
return -EBUSY; return -EBUSY;
if (!cl->level && htb_parent_last_child(cl)) { if (!cl->level && htb_parent_last_child(cl)) {
new_q = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, new_q = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops,
&pfifo_qdisc_ops,
cl->parent->common.classid); cl->parent->common.classid);
last_child = 1; last_child = 1;
} }
@ -1377,7 +1375,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
/* create leaf qdisc early because it uses kmalloc(GFP_KERNEL) /* create leaf qdisc early because it uses kmalloc(GFP_KERNEL)
so that can't be used inside of sch_tree_lock so that can't be used inside of sch_tree_lock
-- thanks to Karlis Peisenieks */ -- thanks to Karlis Peisenieks */
new_q = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, new_q = qdisc_create_dflt(sch->dev_queue,
&pfifo_qdisc_ops, classid); &pfifo_qdisc_ops, classid);
sch_tree_lock(sch); sch_tree_lock(sch);
if (parent && !parent->level) { if (parent && !parent->level) {

View File

@ -56,7 +56,7 @@ static int mq_init(struct Qdisc *sch, struct nlattr *opt)
for (ntx = 0; ntx < dev->num_tx_queues; ntx++) { for (ntx = 0; ntx < dev->num_tx_queues; ntx++) {
dev_queue = netdev_get_tx_queue(dev, ntx); dev_queue = netdev_get_tx_queue(dev, ntx);
qdisc = qdisc_create_dflt(dev, dev_queue, &pfifo_fast_ops, qdisc = qdisc_create_dflt(dev_queue, &pfifo_fast_ops,
TC_H_MAKE(TC_H_MAJ(sch->handle), TC_H_MAKE(TC_H_MAJ(sch->handle),
TC_H_MIN(ntx + 1))); TC_H_MIN(ntx + 1)));
if (qdisc == NULL) if (qdisc == NULL)

View File

@ -227,8 +227,7 @@ static int multiq_tune(struct Qdisc *sch, struct nlattr *opt)
for (i = 0; i < q->bands; i++) { for (i = 0; i < q->bands; i++) {
if (q->queues[i] == &noop_qdisc) { if (q->queues[i] == &noop_qdisc) {
struct Qdisc *child, *old; struct Qdisc *child, *old;
child = qdisc_create_dflt(qdisc_dev(sch), child = qdisc_create_dflt(sch->dev_queue,
sch->dev_queue,
&pfifo_qdisc_ops, &pfifo_qdisc_ops,
TC_H_MAKE(sch->handle, TC_H_MAKE(sch->handle,
i + 1)); i + 1));

View File

@ -538,8 +538,7 @@ static int netem_init(struct Qdisc *sch, struct nlattr *opt)
qdisc_watchdog_init(&q->watchdog, sch); qdisc_watchdog_init(&q->watchdog, sch);
q->qdisc = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, q->qdisc = qdisc_create_dflt(sch->dev_queue, &tfifo_qdisc_ops,
&tfifo_qdisc_ops,
TC_H_MAKE(sch->handle, 1)); TC_H_MAKE(sch->handle, 1));
if (!q->qdisc) { if (!q->qdisc) {
pr_debug("netem: qdisc create failed\n"); pr_debug("netem: qdisc create failed\n");

View File

@ -200,7 +200,7 @@ static int prio_tune(struct Qdisc *sch, struct nlattr *opt)
for (i=0; i<q->bands; i++) { for (i=0; i<q->bands; i++) {
if (q->queues[i] == &noop_qdisc) { if (q->queues[i] == &noop_qdisc) {
struct Qdisc *child, *old; struct Qdisc *child, *old;
child = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, child = qdisc_create_dflt(sch->dev_queue,
&pfifo_qdisc_ops, &pfifo_qdisc_ops,
TC_H_MAKE(sch->handle, i + 1)); TC_H_MAKE(sch->handle, i + 1));
if (child) { if (child) {