Skip to contentSkip to conversation

bpf: Convert to use the preferred fallthrough macro

PATCH linmiaohe 1 participant 1 message Aug 16, 2020

Subsystems (3)
lore
Share & tools
lore

linmiaohe

author
#0 lore raw

Andrii Nakryiko <[email protected]> wrote:

Quoted 10 lines · Miaohe Lin

Review static bool cg_sockopt_is_valid_access(int off, int size, · line 1797

Quoted 8 lines

Convert the uses of fallthrough comments to fallthrough macro.

(quoted diff) +1 -1
@@ -1794,7 +1794,7 @@ static bool cg_sockopt_is_valid_access(int off, int size,
                        return prog->expected_attach_type ==
                                BPF_CGROUP_GETSOCKOPT;
                case offsetof(struct bpf_sockopt, optname):
-                       /* fallthrough */
+                       fallthrough;

this fallthrough is not event necessary, let's drop it instead?

Will do. Many thanks.

Quoted 6 lines
Quoted 4 lines
(quoted diff) +0 -0
                case offsetof(struct bpf_sockopt, level):
                        if (size != size_default)
                                return false;

[...]