* [PATCH net-next] net: sched: remove unnecessary init of qidsc skb head
@ 2022-08-24 9:10 Zhengchao Shao
2022-08-26 11:20 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Zhengchao Shao @ 2022-08-24 9:10 UTC (permalink / raw)
To: netdev, linux-kernel, davem, edumazet, kuba, pabeni, jhs,
xiyou.wangcong, jiri
Cc: weiyongjun1, yuehaibing, shaozhengchao
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>
---
include/net/sch_generic.h | 7 -------
net/sched/sch_generic.c | 1 -
net/sched/sch_htb.c | 2 --
3 files changed, 10 deletions(-)
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index ec693fe7c553..dcdb8474ed68 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 d47b9689eba6..0c0f20f7b9f5 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 23a9d6242429..f43414e42ad5 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -1106,8 +1106,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
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: sched: remove unnecessary init of qidsc skb head
2022-08-24 9:10 [PATCH net-next] net: sched: remove unnecessary init of qidsc skb head Zhengchao Shao
@ 2022-08-26 11:20 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-08-26 11:20 UTC (permalink / raw)
To: Zhengchao Shao
Cc: netdev, linux-kernel, davem, edumazet, kuba, pabeni, jhs,
xiyou.wangcong, jiri, weiyongjun1, yuehaibing
Hello:
This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:
On Wed, 24 Aug 2022 17:10:03 +0800 you wrote:
> 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>
> ---
> include/net/sch_generic.h | 7 -------
> net/sched/sch_generic.c | 1 -
> net/sched/sch_htb.c | 2 --
> 3 files changed, 10 deletions(-)
Here is the summary with links:
- [net-next] net: sched: remove unnecessary init of qidsc skb head
https://git.kernel.org/netdev/net-next/c/44387d1736c4
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-26 11:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-24 9:10 [PATCH net-next] net: sched: remove unnecessary init of qidsc skb head Zhengchao Shao
2022-08-26 11:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).