Skip to contentSkip to conversation

netfilter: Fix fall-through warnings for Clang

PATCH RESEND Applied Gustavo A. R. Silva 2 participants 2 messages Mar 5, 2021 – Mar 17, 2021

Subsystems (3)

v1 of 3 Applied Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 netfilter: Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

---
 net/netfilter/nf_conntrack_proto_dccp.c | 1 +
 net/netfilter/nf_tables_api.c           | 1 +
 net/netfilter/nft_ct.c                  | 1 +
 3 files changed, 3 insertions(+)
net/netfilter/nf_conntrack_proto_dccp.c +1 -0
index db7479db8512..4f33307fa3cf 100644
@@ -397,6 +397,7 @@ dccp_new(struct nf_conn *ct, const struct sk_buff *skb,
 			msg = "not picking up existing connection ";
 			goto out_invalid;
 		}
+		break;
 	case CT_DCCP_REQUEST:
 		break;
 	case CT_DCCP_INVALID:
net/netfilter/nf_tables_api.c +1 -0
index b07703e19108..1f53459e30e9 100644
@@ -8557,6 +8557,7 @@ static int nf_tables_check_loops(const struct nft_ctx *ctx,
 							data->verdict.chain);
 				if (err < 0)
 					return err;
+				break;
 			default:
 				break;
 			}
net/netfilter/nft_ct.c +1 -0
index 882fe8648653..0592a9456084 100644
@@ -527,6 +527,7 @@ static void __nft_ct_set_destroy(const struct nft_ctx *ctx, struct nft_ct *priv)
 	case NFT_CT_ZONE:
 		if (--nft_ct_pcpu_template_refcnt == 0)
 			nft_ct_tmpl_put_pcpu();
+		break;
 #endif
 	default:
 		break;
Signature · 1 line
2.27.0
maintainer Applied
#1 lore raw
Quoted 3 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

Applied to nf-next, thanks.