netfilter: mark expected switch fall-throughs
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Tue, 7 Nov 2017 14:19:29 +0000 (08:19 -0600)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 8 Jan 2018 17:01:01 +0000 (18:01 +0100)
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>
net/netfilter/ipset/ip_set_core.c
net/netfilter/ipvs/ip_vs_proto_tcp.c
net/netfilter/ipvs/ip_vs_proto_udp.c
net/netfilter/nf_conntrack_h323_asn1.c
net/netfilter/nft_cmp.c
net/netfilter/x_tables.c

index cf84f7b37cd9dfb828892e23b0aa2603827b6427..d5a43cad90f04c361f7d366f1720d0e2c3982ea8 100644 (file)
@@ -1386,7 +1386,7 @@ dump_last:
                                goto next_set;
                        if (set->variant->uref)
                                set->variant->uref(set, cb, true);
-                       /* Fall through and add elements */
+                       /* fall through */
                default:
                        rcu_read_lock_bh();
                        ret = set->variant->list(set, skb, cb);
index 121a321b91bea816909fc7acb9a2b4316ff7abc9..bcd9b7bde4ee3da423456800436912e06dd46958 100644 (file)
@@ -315,6 +315,7 @@ tcp_csum_check(int af, struct sk_buff *skb, struct ip_vs_protocol *pp)
        switch (skb->ip_summed) {
        case CHECKSUM_NONE:
                skb->csum = skb_checksum(skb, tcphoff, skb->len - tcphoff, 0);
+               /* fall through */
        case CHECKSUM_COMPLETE:
 #ifdef CONFIG_IP_VS_IPV6
                if (af == AF_INET6) {
index 30e11cd6aa8a96562c7cfb4e1cb42a43e5ab830e..c15ef7c2a1fae800189da7351729da4377789143 100644 (file)
@@ -319,6 +319,7 @@ udp_csum_check(int af, struct sk_buff *skb, struct ip_vs_protocol *pp)
                case CHECKSUM_NONE:
                        skb->csum = skb_checksum(skb, udphoff,
                                                 skb->len - udphoff, 0);
+                       /* fall through */
                case CHECKSUM_COMPLETE:
 #ifdef CONFIG_IP_VS_IPV6
                        if (af == AF_INET6) {
index dc6347342e34c499eaef5403f63034b137ad14e3..38cf5e4f30bd6e5562a07304b1bfcd8511950e59 100644 (file)
@@ -262,12 +262,15 @@ static unsigned int get_uint(struct bitstr *bs, int b)
        case 4:
                v |= *bs->cur++;
                v <<= 8;
+               /* fall through */
        case 3:
                v |= *bs->cur++;
                v <<= 8;
+               /* fall through */
        case 2:
                v |= *bs->cur++;
                v <<= 8;
+               /* fall through */
        case 1:
                v |= *bs->cur++;
                break;
index c2945eb3397c8991ae05ea84abb2ba15591cbefb..fa90a8402845d1768fce3741e3173a8493268558 100644 (file)
@@ -44,6 +44,7 @@ static void nft_cmp_eval(const struct nft_expr *expr,
        case NFT_CMP_LT:
                if (d == 0)
                        goto mismatch;
+               /* fall through */
        case NFT_CMP_LTE:
                if (d > 0)
                        goto mismatch;
@@ -51,6 +52,7 @@ static void nft_cmp_eval(const struct nft_expr *expr,
        case NFT_CMP_GT:
                if (d == 0)
                        goto mismatch;
+               /* fall through */
        case NFT_CMP_GTE:
                if (d < 0)
                        goto mismatch;
index 55802e97f906d1987ed78b4296584deb38e5f876..0d9efc3cb451671d6d6c3c4c88fab420165e7f3f 100644 (file)
@@ -1397,7 +1397,7 @@ static void *xt_mttg_seq_next(struct seq_file *seq, void *v, loff_t *ppos,
                trav->curr = trav->curr->next;
                if (trav->curr != trav->head)
                        break;
-               /* fallthru, _stop will unlock */
+               /* fall through */
        default:
                return NULL;
        }