diff options
author | Yejune Deng <yejune.deng@gmail.com> | 2021-01-14 05:14:56 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-01-16 05:22:16 +0100 |
commit | f4d133d86af7f39a0f5bdaf7a888ec7b84733b5e (patch) | |
tree | 8d7305ad3fec54de3cb8e111c1618450fb45b102 /net/ipv4/tcp_cubic.c | |
parent | net: tap: check vlan with eth_type_vlan() method (diff) | |
download | linux-f4d133d86af7f39a0f5bdaf7a888ec7b84733b5e.tar.xz linux-f4d133d86af7f39a0f5bdaf7a888ec7b84733b5e.zip |
tcp_cubic: use memset and offsetof init
In bictcp_reset(), use memset and offsetof instead of = 0.
Signed-off-by: Yejune Deng <yejune.deng@gmail.com>
Link: https://lore.kernel.org/r/1610597696-128610-1-git-send-email-yejune.deng@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv4/tcp_cubic.c')
-rw-r--r-- | net/ipv4/tcp_cubic.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c index c7bf5b26bf0c..ffcbe46dacdb 100644 --- a/net/ipv4/tcp_cubic.c +++ b/net/ipv4/tcp_cubic.c @@ -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; } |