BACKPORT: treewide: Use fallthrough pseudo-keyword

Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

Only apply changes to bpf, not treewide.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Change-Id: I56f83316fa51615b5e0bc37762f321223f7c1a7f
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
This commit is contained in:
Gustavo A. R. Silva 2020-08-23 17:36:59 -05:00 • committed by basamaryan
commit 2557da9098
No known key found for this signature in database
GPG key ID: 210D5384FB2A5885
4 changed files with 4 additions and 4 deletions

View file

@ -1855,7 +1855,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;
case offsetof(struct bpf_sockopt, level):
if (size != size_default)
return false;

View file

@ -266,7 +266,7 @@ static int cpu_map_bpf_prog_run_xdp(struct bpf_cpu_map_entry *rcpu,
break;
default:
bpf_warn_invalid_xdp_action(act);
/* fallthrough */
fallthrough;
case XDP_DROP:
xdp_return_frame(xdpf);
stats->drop++;

View file

@ -2056,7 +2056,7 @@ bpf_prog_load_check_attach(enum bpf_prog_type prog_type,
case BPF_PROG_TYPE_EXT:
if (expected_attach_type)
return -EINVAL;
/* fallthrough */
fallthrough;
default:
return 0;
}

View file

@ -12398,7 +12398,7 @@ int bpf_check_attach_target(struct bpf_verifier_log *log,
default:
if (!prog_extension)
return -EINVAL;
/* fallthrough */
fallthrough;
case BPF_MODIFY_RETURN:
case BPF_LSM_MAC:
case BPF_TRACE_FENTRY: