Commit f4d133d8 authored by Yejune Deng's avatar Yejune Deng Committed by Jakub Kicinski

tcp_cubic: use memset and offsetof init

In bictcp_reset(), use memset and offsetof instead of = 0.
Signed-off-by: default avatarYejune Deng <yejune.deng@gmail.com>
Link: https://lore.kernel.org/r/1610597696-128610-1-git-send-email-yejune.deng@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent b69df260
...@@ -104,16 +104,7 @@ struct bictcp { ...@@ -104,16 +104,7 @@ struct bictcp {
static inline void bictcp_reset(struct bictcp *ca) static inline void bictcp_reset(struct bictcp *ca)
{ {
ca->cnt = 0; memset(ca, 0, offsetof(struct bictcp, unused));
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;
ca->found = 0; ca->found = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment