Skip to content

Commit 583c531

Browse files
malaterreborkmann
authored andcommitted
bpf: Make function btf_name_offset_valid static
Initially in commit 69b693f ("bpf: btf: Introduce BPF Type Format (BTF)") the function 'btf_name_offset_valid' was introduced as static function it was later on changed to a non-static one, and then finally in commit 23127b3 ("bpf: Create a new btf_name_by_offset() for non type name use case") the function prototype was removed. Revert back to original implementation and make the function static. Remove warning triggered with W=1: kernel/bpf/btf.c:470:6: warning: no previous prototype for 'btf_name_offset_valid' [-Wmissing-prototypes] Fixes: 23127b3 ("bpf: Create a new btf_name_by_offset() for non type name use case") Signed-off-by: Mathieu Malaterre <malat@debian.org> Acked-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
1 parent f67ad87 commit 583c531

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/bpf/btf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ static const struct btf_kind_operations *btf_type_ops(const struct btf_type *t)
467467
return kind_ops[BTF_INFO_KIND(t->info)];
468468
}
469469

470-
bool btf_name_offset_valid(const struct btf *btf, u32 offset)
470+
static bool btf_name_offset_valid(const struct btf *btf, u32 offset)
471471
{
472472
return BTF_STR_OFFSET_VALID(offset) &&
473473
offset < btf->hdr.str_len;

0 commit comments

Comments
 (0)