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: Zhengchao Shao <shaozhengchao@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
643952f3ec
commit
44387d1736
@ -940,13 +940,6 @@ static inline void qdisc_purge_queue(struct Qdisc *sch)
|
|||||||
qdisc_tree_reduce_backlog(sch, qlen, backlog);
|
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,
|
static inline void __qdisc_enqueue_tail(struct sk_buff *skb,
|
||||||
struct qdisc_skb_head *qh)
|
struct qdisc_skb_head *qh)
|
||||||
{
|
{
|
||||||
|
@ -941,7 +941,6 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
|
|||||||
goto errout;
|
goto errout;
|
||||||
__skb_queue_head_init(&sch->gso_skb);
|
__skb_queue_head_init(&sch->gso_skb);
|
||||||
__skb_queue_head_init(&sch->skb_bad_txq);
|
__skb_queue_head_init(&sch->skb_bad_txq);
|
||||||
qdisc_skb_head_init(&sch->q);
|
|
||||||
gnet_stats_basic_sync_init(&sch->bstats);
|
gnet_stats_basic_sync_init(&sch->bstats);
|
||||||
spin_lock_init(&sch->q.lock);
|
spin_lock_init(&sch->q.lock);
|
||||||
|
|
||||||
|
@ -1104,8 +1104,6 @@ static int htb_init(struct Qdisc *sch, struct nlattr *opt,
|
|||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto err_free_direct_qdiscs;
|
goto err_free_direct_qdiscs;
|
||||||
|
|
||||||
qdisc_skb_head_init(&q->direct_queue);
|
|
||||||
|
|
||||||
if (tb[TCA_HTB_DIRECT_QLEN])
|
if (tb[TCA_HTB_DIRECT_QLEN])
|
||||||
q->direct_qlen = nla_get_u32(tb[TCA_HTB_DIRECT_QLEN]);
|
q->direct_qlen = nla_get_u32(tb[TCA_HTB_DIRECT_QLEN]);
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user