Commit 27a245ee authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[PKT_SCHED]: Remove unnecessary memsets in packet schedulers

This patch removes some more unnecessary memsets in packet
schedulers. The qdisc's private data is already set to 0
in qdisc_create/qdisc_create_dflt.
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@redhat.com>
parent da5a8794
......@@ -573,7 +573,6 @@ static int atm_tc_init(struct Qdisc *sch,struct rtattr *opt)
struct atm_qdisc_data *p = PRIV(sch);
DPRINTK("atm_tc_init(sch %p,[qdisc %p],opt %p)\n",sch,p,opt);
memset(p,0,sizeof(*p));
p->flows = &p->link;
if(!(p->link.q = qdisc_create_dflt(sch->dev,&pfifo_qdisc_ops)))
p->link.q = &noop_qdisc;
......
......@@ -331,8 +331,6 @@ int dsmark_init(struct Qdisc *sch,struct rtattr *opt)
!tb[TCA_DSMARK_INDICES-1] ||
RTA_PAYLOAD(tb[TCA_DSMARK_INDICES-1]) < sizeof(__u16))
return -EINVAL;
memset(p,0,sizeof(*p));
p->filter_list = NULL;
p->indices = *(__u16 *) RTA_DATA(tb[TCA_DSMARK_INDICES-1]);
if (!p->indices)
return -EINVAL;
......
......@@ -1530,7 +1530,6 @@ hfsc_init_qdisc(struct Qdisc *sch, struct rtattr *opt)
return -EINVAL;
qopt = RTA_DATA(opt);
memset(q, 0, sizeof(struct hfsc_sched));
sch->stats_lock = &sch->dev->queue_lock;
q->defcls = qopt->defcls;
......
......@@ -1277,7 +1277,6 @@ static int htb_init(struct Qdisc *sch, struct rtattr *opt)
HTB_VER >> 16,HTB_VER & 0xffff,gopt->version);
return -EINVAL;
}
memset(q,0,sizeof(*q));
q->debug = gopt->debug;
HTB_DBG(0,1,"htb_init sch=%p handle=%X r2q=%d\n",sch,sch->handle,gopt->rate2quantum);
......
......@@ -289,9 +289,6 @@ int ingress_init(struct Qdisc *sch,struct rtattr *opt)
#endif
#endif
if (NULL == p)
goto error;
#ifndef CONFIG_NET_CLS_ACT
#ifdef CONFIG_NETFILTER
if (!nf_registered) {
......@@ -305,8 +302,6 @@ int ingress_init(struct Qdisc *sch,struct rtattr *opt)
#endif
DPRINTK("ingress_init(sch %p,[qdisc %p],opt %p)\n",sch,p,opt);
memset(p, 0, sizeof(*p));
p->filter_list = NULL;
p->q = &noop_qdisc;
return 0;
error:
......@@ -346,9 +341,6 @@ static void ingress_destroy(struct Qdisc *sch)
p->filter_list = tp->next;
tcf_destroy(tp);
}
memset(p, 0, sizeof(*p));
p->filter_list = NULL;
#if 0
/* for future use */
qdisc_destroy(p->q);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment