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) ...@@ -573,7 +573,6 @@ static int atm_tc_init(struct Qdisc *sch,struct rtattr *opt)
struct atm_qdisc_data *p = PRIV(sch); struct atm_qdisc_data *p = PRIV(sch);
DPRINTK("atm_tc_init(sch %p,[qdisc %p],opt %p)\n",sch,p,opt); DPRINTK("atm_tc_init(sch %p,[qdisc %p],opt %p)\n",sch,p,opt);
memset(p,0,sizeof(*p));
p->flows = &p->link; p->flows = &p->link;
if(!(p->link.q = qdisc_create_dflt(sch->dev,&pfifo_qdisc_ops))) if(!(p->link.q = qdisc_create_dflt(sch->dev,&pfifo_qdisc_ops)))
p->link.q = &noop_qdisc; p->link.q = &noop_qdisc;
......
...@@ -331,8 +331,6 @@ int dsmark_init(struct Qdisc *sch,struct rtattr *opt) ...@@ -331,8 +331,6 @@ int dsmark_init(struct Qdisc *sch,struct rtattr *opt)
!tb[TCA_DSMARK_INDICES-1] || !tb[TCA_DSMARK_INDICES-1] ||
RTA_PAYLOAD(tb[TCA_DSMARK_INDICES-1]) < sizeof(__u16)) RTA_PAYLOAD(tb[TCA_DSMARK_INDICES-1]) < sizeof(__u16))
return -EINVAL; return -EINVAL;
memset(p,0,sizeof(*p));
p->filter_list = NULL;
p->indices = *(__u16 *) RTA_DATA(tb[TCA_DSMARK_INDICES-1]); p->indices = *(__u16 *) RTA_DATA(tb[TCA_DSMARK_INDICES-1]);
if (!p->indices) if (!p->indices)
return -EINVAL; return -EINVAL;
......
...@@ -1530,7 +1530,6 @@ hfsc_init_qdisc(struct Qdisc *sch, struct rtattr *opt) ...@@ -1530,7 +1530,6 @@ hfsc_init_qdisc(struct Qdisc *sch, struct rtattr *opt)
return -EINVAL; return -EINVAL;
qopt = RTA_DATA(opt); qopt = RTA_DATA(opt);
memset(q, 0, sizeof(struct hfsc_sched));
sch->stats_lock = &sch->dev->queue_lock; sch->stats_lock = &sch->dev->queue_lock;
q->defcls = qopt->defcls; q->defcls = qopt->defcls;
......
...@@ -1277,7 +1277,6 @@ static int htb_init(struct Qdisc *sch, struct rtattr *opt) ...@@ -1277,7 +1277,6 @@ static int htb_init(struct Qdisc *sch, struct rtattr *opt)
HTB_VER >> 16,HTB_VER & 0xffff,gopt->version); HTB_VER >> 16,HTB_VER & 0xffff,gopt->version);
return -EINVAL; return -EINVAL;
} }
memset(q,0,sizeof(*q));
q->debug = gopt->debug; q->debug = gopt->debug;
HTB_DBG(0,1,"htb_init sch=%p handle=%X r2q=%d\n",sch,sch->handle,gopt->rate2quantum); 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) ...@@ -289,9 +289,6 @@ int ingress_init(struct Qdisc *sch,struct rtattr *opt)
#endif #endif
#endif #endif
if (NULL == p)
goto error;
#ifndef CONFIG_NET_CLS_ACT #ifndef CONFIG_NET_CLS_ACT
#ifdef CONFIG_NETFILTER #ifdef CONFIG_NETFILTER
if (!nf_registered) { if (!nf_registered) {
...@@ -305,8 +302,6 @@ int ingress_init(struct Qdisc *sch,struct rtattr *opt) ...@@ -305,8 +302,6 @@ int ingress_init(struct Qdisc *sch,struct rtattr *opt)
#endif #endif
DPRINTK("ingress_init(sch %p,[qdisc %p],opt %p)\n",sch,p,opt); 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; p->q = &noop_qdisc;
return 0; return 0;
error: error:
...@@ -346,9 +341,6 @@ static void ingress_destroy(struct Qdisc *sch) ...@@ -346,9 +341,6 @@ static void ingress_destroy(struct Qdisc *sch)
p->filter_list = tp->next; p->filter_list = tp->next;
tcf_destroy(tp); tcf_destroy(tp);
} }
memset(p, 0, sizeof(*p));
p->filter_list = NULL;
#if 0 #if 0
/* for future use */ /* for future use */
qdisc_destroy(p->q); 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