diff options
author | Phil Sutter <phil@nwl.cc> | 2018-02-28 16:06:16 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-02-28 16:59:19 +0100 |
commit | 7f31d3191622b650521014e311ace96aa7c5522c (patch) | |
tree | e27bde4056fd7b21f3d09aaf689aa2573238afc9 /src/rule.c | |
parent | 48b99f03b5e43eac2bf93251f8fa1c9ceb516abb (diff) |
Review switch statements for unmarked fall through cases
While revisiting all of them, clear a few oddities as well:
- There's no point in marking empty fall through cases: They are easy to
spot and a common concept when using switch().
- Fix indenting of break statement in one occasion.
- Drop needless braces around one case which doesn't declare variables.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src/rule.c')
-rw-r--r-- | src/rule.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1341,7 +1341,7 @@ static void obj_print_data(const struct obj *obj, } } break; - case NFT_OBJECT_CT_HELPER: { + case NFT_OBJECT_CT_HELPER: nft_print(octx, "ct helper %s {\n", obj->handle.obj); nft_print(octx, "\t\ttype \"%s\" protocol ", obj->ct_helper.name); @@ -1349,7 +1349,6 @@ static void obj_print_data(const struct obj *obj, nft_print(octx, "\t\tl3proto %s", family2str(obj->ct_helper.l3proto)); break; - } case NFT_OBJECT_LIMIT: { bool inv = obj->limit.flags & NFT_LIMIT_F_INV; const char *data_unit; @@ -1661,11 +1660,13 @@ static int do_command_reset(struct netlink_ctx *ctx, struct cmd *cmd) switch (cmd->obj) { case CMD_OBJ_COUNTERS: dump = true; + /* fall through */ case CMD_OBJ_COUNTER: type = NFT_OBJECT_COUNTER; break; case CMD_OBJ_QUOTAS: dump = true; + /* fall through */ case CMD_OBJ_QUOTA: type = NFT_OBJECT_QUOTA; break; |