Skip to contentSkip to conversation

tipc: mark expected switch fall-throughs

PATCH Applied Gustavo A. R. Silva 3 participants 3 messages Jul 4, 2018 – Jul 5, 2018

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

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

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

Warning level 2 was used: -Wimplicit-fallthrough=2

---
 net/tipc/bearer.c | 1 +
 net/tipc/link.c   | 1 +
 2 files changed, 2 insertions(+)
net/tipc/bearer.c +1 -0
index 2dfb492..fd6d8f1 100644
@@ -610,6 +610,7 @@ static int tipc_l2_device_event(struct notifier_block *nb, unsigned long evt,
 	case NETDEV_CHANGE:
 		if (netif_carrier_ok(dev))
 			break;
+		/* else: fall through */
 	case NETDEV_UP:
 		test_and_set_bit_lock(0, &b->up);
 		break;
net/tipc/link.c +1 -0
index 695acb7..6386032 100644
@@ -1063,6 +1063,7 @@ static bool tipc_data_input(struct tipc_link *l, struct sk_buff *skb,
 			skb_queue_tail(mc_inputq, skb);
 			return true;
 		}
+		/* else: fall through */
 	case CONN_MANAGER:
 		skb_queue_tail(inputq, skb);
 		return true;
Signature · 1 line
2.7.4
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Gustavo A. R. Silva

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

Warning level 2 was used: -Wimplicit-fallthrough=2

Quoted 30 lines
---
 net/tipc/bearer.c | 1 +
 net/tipc/link.c   | 1 +
 2 files changed, 2 insertions(+)
net/tipc/bearer.c +1 -0
index 2dfb492..fd6d8f1 100644
@@ -610,6 +610,7 @@ static int tipc_l2_device_event(struct notifier_block *nb, unsigned long evt,
 	case NETDEV_CHANGE:
 		if (netif_carrier_ok(dev))
 			break;
+		/* else: fall through */
 	case NETDEV_UP:
 		test_and_set_bit_lock(0, &b->up);
 		break;
net/tipc/link.c +1 -0
index 695acb7..6386032 100644
@@ -1063,6 +1063,7 @@ static bool tipc_data_input(struct tipc_link *l, struct sk_buff *skb,
 			skb_queue_tail(mc_inputq, skb);
 			return true;
 		}
+		/* else: fall through */
 	case CONN_MANAGER:
 		skb_queue_tail(inputq, skb);
 		return true;