summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhengchao Shao <shaozhengchao@huawei.com>2022-08-24 11:10:03 +0200
committerDavid S. Miller <davem@davemloft.net>2022-08-26 13:03:04 +0200
commit44387d1736c40a74085be354e2b5f37ca0689608 (patch)
treebf5cba8882865b7ab75aaa906ee2f74bb06b9cf9
parentMerge tag 'wireless-next-2022-08-26-v2' of git://git.kernel.org/pub/scm/linux... (diff)
downloadlinux-44387d1736c40a74085be354e2b5f37ca0689608.tar.xz
linux-44387d1736c40a74085be354e2b5f37ca0689608.zip
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>
-rw-r--r--include/net/sch_generic.h7
-rw-r--r--net/sched/sch_generic.c1
-rw-r--r--net/sched/sch_htb.c2
3 files changed, 0 insertions, 10 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index f2958fb5ae08..7dc83400bde4 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -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)
{
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 99b697ad2b98..8d25b41d22ec 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -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);
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index cb5872d22ecf..dbbb276aecb3 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -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