Skip to contentSkip to conversation

net: dccp: mark expected switch fall-throughs

PATCH Applied Gustavo A. R. Silva 2 participants 2 messages Oct 15, 2017 – Oct 16, 2017

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

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

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

Notice that for options.c file, I placed the "fall through" comment on its own line, which is what GCC is expecting to find.

---
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/dccp/input.c   | 1 +
 net/dccp/options.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
net/dccp/input.c +1 -0
index fa6be97..d28d46b 100644
@@ -534,6 +534,7 @@ static int dccp_rcv_respond_partopen_state_process(struct sock *sk,
 	case DCCP_PKT_DATA:
 		if (sk->sk_state = DCCP_RESPOND)
 			break;
+		/* fall through */
 	case DCCP_PKT_DATAACK:
 	case DCCP_PKT_ACK:
 		/*
net/dccp/options.c +1 -1
index 51cdfc3..4e40db0 100644
@@ -227,8 +227,8 @@ int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq,
 			 * Ack vectors are processed by the TX CCID if it is
 			 * interested. The RX CCID need not parse Ack Vectors,
 			 * since it is only interested in clearing old state.
-			 * Fall through.
 			 */
+			/* fall through */
 		case DCCPO_MIN_TX_CCID_SPECIFIC ... DCCPO_MAX_TX_CCID_SPECIFIC:
 			if (ccid_hc_tx_parse_options(dp->dccps_hc_tx_ccid, sk,
 						     pkt_type, opt, value, len))
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw

From: "Gustavo A. R. Silva" <[email protected]>
Date: Sun, 15 Oct 2017 13:22:10 -0500

Quoted 7 lines

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

Notice that for options.c file, I placed the "fall through" comment on its own line, which is what GCC is expecting to find.

Applied to net-next.