bpf: simplify btf_get_prog_ctx_type() into btf_is_prog_ctx_type()
authorAndrii Nakryiko <andrii@kernel.org>
Mon, 12 Feb 2024 23:32:18 +0000 (15:32 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 14 Feb 2024 02:46:46 +0000 (18:46 -0800)
commitfb5b86cfd4ef21ea18966718f6bf6c8f1b9df12e
treeeb856ee133bdfa5517d4e25a7331ce560ba56b22
parent32e18e7688c6847b0c9db073aafb00639ecf576c
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>
include/linux/btf.h
kernel/bpf/btf.c
kernel/bpf/verifier.c