libbpf: Expose btf_type_by_id() internally

btf_type_by_id() is internal-only convenience API returning non-const pointer
to struct btf_type. Expose it outside of btf.c for re-use.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210318194036.3521577-2-andrii@kernel.org
This commit is contained in:
Andrii Nakryiko
2021-03-18 12:40:25 -07:00
committed by Andrii Nakryiko
parent 75a2e3bda8
commit 082a5c6020
2 changed files with 6 additions and 1 deletions

View File

@@ -435,7 +435,7 @@ const struct btf *btf__base_btf(const struct btf *btf)
}
/* internal helper returning non-const pointer to a type */
static struct btf_type *btf_type_by_id(struct btf *btf, __u32 type_id)
struct btf_type *btf_type_by_id(struct btf *btf, __u32 type_id)
{
if (type_id == 0)
return &btf_void;