[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8c690953a808295294043362ed69e379316c4ace.camel@perches.com>
Date: Wed, 09 May 2018 22:49:15 -0700
From: Joe Perches <joe@...ches.com>
To: Li RongQing <lirongqing@...du.com>, netdev@...r.kernel.org
Subject: Re: [net-next][PATCH] inet: Use switch case instead of multiple
condition checks
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:
Powered by blists - more mailing lists