Commit 44387d17 authored by Zhengchao Shao's avatar Zhengchao Shao Committed by David S. Miller
Browse files

net: sched: remove unnecessary init of qdisc skb head



The memory allocated by using kzallloc_node and kcalloc has been cleared.
Therefore, the structure members of the new qdisc are 0. So there's no
need to explicitly assign a value of 0.

Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 643952f3
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -940,13 +940,6 @@ static inline void qdisc_purge_queue(struct Qdisc *sch)
	qdisc_tree_reduce_backlog(sch, qlen, backlog);
}

static inline void qdisc_skb_head_init(struct qdisc_skb_head *qh)
{
	qh->head = NULL;
	qh->tail = NULL;
	qh->qlen = 0;
}

static inline void __qdisc_enqueue_tail(struct sk_buff *skb,
					struct qdisc_skb_head *qh)
{
+0 −1
Original line number Diff line number Diff line
@@ -941,7 +941,6 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
		goto errout;
	__skb_queue_head_init(&sch->gso_skb);
	__skb_queue_head_init(&sch->skb_bad_txq);
	qdisc_skb_head_init(&sch->q);
	gnet_stats_basic_sync_init(&sch->bstats);
	spin_lock_init(&sch->q.lock);

+0 −2
Original line number Diff line number Diff line
@@ -1104,8 +1104,6 @@ static int htb_init(struct Qdisc *sch, struct nlattr *opt,
	if (err < 0)
		goto err_free_direct_qdiscs;

	qdisc_skb_head_init(&q->direct_queue);

	if (tb[TCA_HTB_DIRECT_QLEN])
		q->direct_qlen = nla_get_u32(tb[TCA_HTB_DIRECT_QLEN]);
	else