diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2024-02-13 00:32:18 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2024-02-14 03:46:46 +0100 |
commit | fb5b86cfd4ef21ea18966718f6bf6c8f1b9df12e (patch) | |
tree | eb856ee133bdfa5517d4e25a7331ce560ba56b22 /kernel/bpf/verifier.c | |
parent | bpf: remove check in __cgroup_bpf_run_filter_skb (diff) | |
download | linux-fb5b86cfd4ef21ea18966718f6bf6c8f1b9df12e.tar.xz linux-fb5b86cfd4ef21ea18966718f6bf6c8f1b9df12e.zip |
bpf: simplify btf_get_prog_ctx_type() into btf_is_prog_ctx_type()
Return result of btf_get_prog_ctx_type() is never used and callers only
check NULL vs non-NULL case to determine if given type matches expected
PTR_TO_CTX type. So rename function to `btf_is_prog_ctx_type()` and
return a simple true/false. We'll use this simpler interface to handle
kprobe program type's special typedef case in the next patch.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20240212233221.2575350-2-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/bpf/verifier.c')
-rw-r--r-- | kernel/bpf/verifier.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 72ca27f49616..aa192dc735a9 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -11015,7 +11015,7 @@ get_kfunc_ptr_arg_type(struct bpf_verifier_env *env, * type to our caller. When a set of conditions hold in the BTF type of * arguments, we resolve it to a known kfunc_ptr_arg_type. */ - if (btf_get_prog_ctx_type(&env->log, meta->btf, t, resolve_prog_type(env->prog), argno)) + if (btf_is_prog_ctx_type(&env->log, meta->btf, t, resolve_prog_type(env->prog), argno)) return KF_ARG_PTR_TO_CTX; if (is_kfunc_arg_alloc_obj(meta->btf, &args[argno])) |