[PATCH] tipc: mark expected switch fall-throughs

Subsystems: networking [general], the rest, tipc network layer

STALE2986d

3 messages, 3 authors, 2018-07-05 · open the first message on its own page

[PATCH] tipc: mark expected switch fall-throughs

From: Gustavo A. R. Silva <hidden>
Date: 2018-07-04 21:39:24

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

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

Signed-off-by: Gustavo A. R. Silva <redacted>
---
 net/tipc/bearer.c | 1 +
 net/tipc/link.c   | 1 +
 2 files changed, 2 insertions(+)
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index 2dfb492..fd6d8f1 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -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;
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 695acb7..6386032 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -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;
-- 
2.7.4

Re: [PATCH] tipc: mark expected switch fall-throughs

From: Ying Xue <hidden>
Date: 2018-07-05 06:02:37

On 07/05/2018 05:13 AM, Gustavo A. R. Silva wrote:
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

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

Signed-off-by: Gustavo A. R. Silva <redacted>
Acked-by: Ying Xue <redacted>
quoted hunk
---
 net/tipc/bearer.c | 1 +
 net/tipc/link.c   | 1 +
 2 files changed, 2 insertions(+)
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index 2dfb492..fd6d8f1 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -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;
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 695acb7..6386032 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -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;

Re: [PATCH] tipc: mark expected switch fall-throughs

From: David Miller <davem@davemloft.net>
Date: 2018-07-05 11:24:46

From: "Gustavo A. R. Silva" <redacted>
Date: Wed, 4 Jul 2018 16:13:59 -0500
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

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

Signed-off-by: Gustavo A. R. Silva <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help