summaryrefslogtreecommitdiffstats
path: root/net/netfilter/nft_compat.c
diff options
context:
space:
mode:
authorDavid Miller2015-04-08 05:05:42 +0200
committerDavid S. Miller2015-04-08 21:20:50 +0200
commitc1f866767777d1c6abae0ec57effffcb72017c00 (patch)
treeb4d26d6d3f93a8a5129d0e2718f3a4a28f71c25c /net/netfilter/nft_compat.c
parentMerge branch 'selinux-nlmsg' (diff)
downloadkernel-qcow2-linux-c1f866767777d1c6abae0ec57effffcb72017c00.tar.gz
kernel-qcow2-linux-c1f866767777d1c6abae0ec57effffcb72017c00.tar.xz
kernel-qcow2-linux-c1f866767777d1c6abae0ec57effffcb72017c00.zip
netfilter: Fix switch statement warnings with recent gcc.
More recent GCC warns about two kinds of switch statement uses: 1) Switching on an enumeration, but not having an explicit case statement for all members of the enumeration. To show the compiler this is intentional, we simply add a default case with nothing more than a break statement. 2) Switching on a boolean value. I think this warning is dumb but nevertheless you get it wholesale with -Wswitch. This patch cures all such warnings in netfilter. Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nft_compat.c')
-rw-r--r--net/netfilter/nft_compat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/netfilter/nft_compat.c b/net/netfilter/nft_compat.c
index 589b8487cd08..0d137c1ac889 100644
--- a/net/netfilter/nft_compat.c
+++ b/net/netfilter/nft_compat.c
@@ -321,11 +321,11 @@ static void nft_match_eval(const struct nft_expr *expr,
return;
}
- switch(ret) {
- case true:
+ switch (ret ? 1 : 0) {
+ case 1:
data[NFT_REG_VERDICT].verdict = NFT_CONTINUE;
break;
- case false:
+ case 0:
data[NFT_REG_VERDICT].verdict = NFT_BREAK;
break;
}