Skip to contentSkip to conversation

net: tipc: mark expected switch fall-throughs

PATCH In review Gustavo A. R. Silva 2 participants 2 messages Oct 20, 2017 – Oct 22, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: tipc: mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

---
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(-)
net/tipc/bearer.c +1 -0
index 47ec121..786dcfd 100644
@@ -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;
net/tipc/link.c +2 -1
index 870b9b8..fc1714e 100644
@@ -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:
 
net/tipc/socket.c +2 -2
index 2bbab4f..ce6cd01 100644
@@ -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)
Signature · 1 line
2.7.4