Skip to contentSkip to conversation

tcp_cubic: use memset and offsetof init

PATCH Applied Yejune Deng 2 participants 2 messages Jan 14, 2021 – Jan 16, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcp_cubic: use memset and offsetof init

In bictcp_reset(), use memset and offsetof instead of = 0.

---
 net/ipv4/tcp_cubic.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
net/ipv4/tcp_cubic.c +1 -10
index c7bf5b2..ffcbe46 100644
@@ -104,16 +104,7 @@ struct bictcp {
 
 static inline void bictcp_reset(struct bictcp *ca)
 {
-	ca->cnt = 0;
-	ca->last_max_cwnd = 0;
-	ca->last_cwnd = 0;
-	ca->last_time = 0;
-	ca->bic_origin_point = 0;
-	ca->bic_K = 0;
-	ca->delay_min = 0;
-	ca->epoch_start = 0;
-	ca->ack_cnt = 0;
-	ca->tcp_cwnd = 0;
+	memset(ca, 0, offsetof(struct bictcp, unused));
 	ca->found = 0;
 }
 
Signature · 1 line
1.9.1
#1 lore raw
This patch was applied to netdev/net-next.git (refs/heads/master):

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

Quoted 6 lines · On Thu, 14 Jan 2021 12:14:56 +0800 you wrote:

In bictcp_reset(), use memset and offsetof instead of = 0.

---
 net/ipv4/tcp_cubic.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Here is the summary with links:
- tcp_cubic: use memset and offsetof init

    https://git.kernel.org/netdev/net-next/c/f4d133d86af7

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html