mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
netfilter: mark expected switch fall-throughs
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
9dae47aba0
commit
e8542dcec0
6 changed files with 9 additions and 2 deletions
|
@ -1386,7 +1386,7 @@ dump_last:
|
||||||
goto next_set;
|
goto next_set;
|
||||||
if (set->variant->uref)
|
if (set->variant->uref)
|
||||||
set->variant->uref(set, cb, true);
|
set->variant->uref(set, cb, true);
|
||||||
/* Fall through and add elements */
|
/* fall through */
|
||||||
default:
|
default:
|
||||||
rcu_read_lock_bh();
|
rcu_read_lock_bh();
|
||||||
ret = set->variant->list(set, skb, cb);
|
ret = set->variant->list(set, skb, cb);
|
||||||
|
|
|
@ -315,6 +315,7 @@ tcp_csum_check(int af, struct sk_buff *skb, struct ip_vs_protocol *pp)
|
||||||
switch (skb->ip_summed) {
|
switch (skb->ip_summed) {
|
||||||
case CHECKSUM_NONE:
|
case CHECKSUM_NONE:
|
||||||
skb->csum = skb_checksum(skb, tcphoff, skb->len - tcphoff, 0);
|
skb->csum = skb_checksum(skb, tcphoff, skb->len - tcphoff, 0);
|
||||||
|
/* fall through */
|
||||||
case CHECKSUM_COMPLETE:
|
case CHECKSUM_COMPLETE:
|
||||||
#ifdef CONFIG_IP_VS_IPV6
|
#ifdef CONFIG_IP_VS_IPV6
|
||||||
if (af == AF_INET6) {
|
if (af == AF_INET6) {
|
||||||
|
|
|
@ -319,6 +319,7 @@ udp_csum_check(int af, struct sk_buff *skb, struct ip_vs_protocol *pp)
|
||||||
case CHECKSUM_NONE:
|
case CHECKSUM_NONE:
|
||||||
skb->csum = skb_checksum(skb, udphoff,
|
skb->csum = skb_checksum(skb, udphoff,
|
||||||
skb->len - udphoff, 0);
|
skb->len - udphoff, 0);
|
||||||
|
/* fall through */
|
||||||
case CHECKSUM_COMPLETE:
|
case CHECKSUM_COMPLETE:
|
||||||
#ifdef CONFIG_IP_VS_IPV6
|
#ifdef CONFIG_IP_VS_IPV6
|
||||||
if (af == AF_INET6) {
|
if (af == AF_INET6) {
|
||||||
|
|
|
@ -262,12 +262,15 @@ static unsigned int get_uint(struct bitstr *bs, int b)
|
||||||
case 4:
|
case 4:
|
||||||
v |= *bs->cur++;
|
v |= *bs->cur++;
|
||||||
v <<= 8;
|
v <<= 8;
|
||||||
|
/* fall through */
|
||||||
case 3:
|
case 3:
|
||||||
v |= *bs->cur++;
|
v |= *bs->cur++;
|
||||||
v <<= 8;
|
v <<= 8;
|
||||||
|
/* fall through */
|
||||||
case 2:
|
case 2:
|
||||||
v |= *bs->cur++;
|
v |= *bs->cur++;
|
||||||
v <<= 8;
|
v <<= 8;
|
||||||
|
/* fall through */
|
||||||
case 1:
|
case 1:
|
||||||
v |= *bs->cur++;
|
v |= *bs->cur++;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -44,6 +44,7 @@ static void nft_cmp_eval(const struct nft_expr *expr,
|
||||||
case NFT_CMP_LT:
|
case NFT_CMP_LT:
|
||||||
if (d == 0)
|
if (d == 0)
|
||||||
goto mismatch;
|
goto mismatch;
|
||||||
|
/* fall through */
|
||||||
case NFT_CMP_LTE:
|
case NFT_CMP_LTE:
|
||||||
if (d > 0)
|
if (d > 0)
|
||||||
goto mismatch;
|
goto mismatch;
|
||||||
|
@ -51,6 +52,7 @@ static void nft_cmp_eval(const struct nft_expr *expr,
|
||||||
case NFT_CMP_GT:
|
case NFT_CMP_GT:
|
||||||
if (d == 0)
|
if (d == 0)
|
||||||
goto mismatch;
|
goto mismatch;
|
||||||
|
/* fall through */
|
||||||
case NFT_CMP_GTE:
|
case NFT_CMP_GTE:
|
||||||
if (d < 0)
|
if (d < 0)
|
||||||
goto mismatch;
|
goto mismatch;
|
||||||
|
|
|
@ -1397,7 +1397,7 @@ static void *xt_mttg_seq_next(struct seq_file *seq, void *v, loff_t *ppos,
|
||||||
trav->curr = trav->curr->next;
|
trav->curr = trav->curr->next;
|
||||||
if (trav->curr != trav->head)
|
if (trav->curr != trav->head)
|
||||||
break;
|
break;
|
||||||
/* fallthru, _stop will unlock */
|
/* fall through */
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue