On Thu, 2018-05-10 at 13:37 +0800, Li RongQing wrote: > inet_csk_reset_xmit_timer uses multiple equality condition checks, > so it is better to use switch case instead of them [] > diff --git a/include/net/inet_connection_sock.h > b/include/net/inet_connection_sock.h [] > @@ -239,22 +239,31 @@ static inline void inet_csk_reset_xmit_timer(struct > sock *sk, const int what, > when = max_when; > } > > - if (what == ICSK_TIME_RETRANS || what == ICSK_TIME_PROBE0 || > - what == ICSK_TIME_EARLY_RETRANS || what == ICSK_TIME_LOSS_PROBE || > - what == ICSK_TIME_REO_TIMEOUT) { > + switch (what) { > + case ICSK_TIME_RETRANS: > + /* fall through */ > + case ICSK_TIME_PROBE0: > + /* fall through */ > + case ICSK_TIME_EARLY_RETRANS: > + /* fall through */ > + case ICSK_TIME_LOSS_PROBE: > + /* fall through */ > + case ICSK_TIME_REO_TIMEOUT:
Please remove the /* fall through */ lines and use consecutive case labels like: case ICSK_TIME_RETRANS: case ICSK_TIME_PROBE0: case ICSK_TIME_EARLY_RETRANS: case ICSK_TIME_LOSS_PROBE: case ICSK_TIME_REO_TIMEOUT: