From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753496AbdJTRXn (ORCPT ); Fri, 20 Oct 2017 13:23:43 -0400 Received: from gateway36.websitewelcome.com ([192.185.186.5]:31519 "EHLO gateway36.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753358AbdJTRXl (ORCPT ); Fri, 20 Oct 2017 13:23:41 -0400 X-Greylist: delayed 1334 seconds by postgrey-1.27 at vger.kernel.org; Fri, 20 Oct 2017 13:23:41 EDT Date: Fri, 20 Oct 2017 12:01:26 -0500 From: "Gustavo A. R. Silva" To: Jon Maloy , Ying Xue , "David S. Miller" Cc: netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] net: tipc: mark expected switch fall-throughs Message-ID: <20171020170126.GA16177@embeddedor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 187.172.29.132 X-Exim-ID: 1e5afm-001vnG-I8 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [187.172.29.132]:58336 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 6 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- This code was tested by compilation only (GCC 7.2.0 was used). Please, verify if the actual intention of the code is to fall through. net/tipc/bearer.c | 1 + net/tipc/link.c | 3 ++- net/tipc/socket.c | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index 47ec121..786dcfd 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c @@ -615,6 +615,7 @@ static int tipc_l2_device_event(struct notifier_block *nb, unsigned long evt, case NETDEV_CHANGE: if (netif_carrier_ok(dev)) break; + /* fall through */ case NETDEV_UP: test_and_set_bit_lock(0, &b->up); break; diff --git a/net/tipc/link.c b/net/tipc/link.c index 870b9b8..fc1714e 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c @@ -1051,6 +1051,7 @@ static bool tipc_data_input(struct tipc_link *l, struct sk_buff *skb, skb_queue_tail(mc_inputq, skb); return true; } + /* fall through */ case CONN_MANAGER: skb_queue_tail(inputq, skb); return true; @@ -1463,7 +1464,7 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb, if ((less_eq(msg_session(hdr), l->peer_session)) && (l->peer_session != ANY_SESSION)) break; - /* fall thru' */ + /* fall through */ case ACTIVATE_MSG: diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 2bbab4f..ce6cd01 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -730,7 +730,7 @@ static unsigned int tipc_poll(struct file *file, struct socket *sock, case TIPC_ESTABLISHED: if (!tsk->cong_link_cnt && !tsk_conn_cong(tsk)) revents |= POLLOUT; - /* fall thru' */ + /* fall through */ case TIPC_LISTEN: case TIPC_CONNECTING: if (skb) @@ -2341,7 +2341,7 @@ static int tipc_connect(struct socket *sock, struct sockaddr *dest, * case is EINPROGRESS, rather than EALREADY. */ res = -EINPROGRESS; - /* fall thru' */ + /* fall through */ case TIPC_CONNECTING: if (!timeout) { if (previous == TIPC_CONNECTING) -- 2.7.4