Re: [PATCH] bpf: Make function btf_name_offset_valid static

From: Martin Lau
Date: Wed Jan 16 2019 - 16:17:00 EST


On Wed, Jan 16, 2019 at 08:29:40PM +0100, Mathieu Malaterre wrote:
> Initially in commit 69b693f0aefa ("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 c454a46b5efd ("bpf: Add bpf_line_info support") the function
> prototype was removed.
Instead of c454a46b5efd, it was removed from btf.h in
commit 23127b33ec80 ("bpf: Create a new btf_name_by_offset() for non type name use case")

>
> 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]
>
> Signed-off-by: Mathieu Malaterre <malat@xxxxxxxxxx>
Fixes: 23127b33ec80 ("bpf: Create a new btf_name_by_offset() for non type name use case")

Thanks for the fix!

Other than the above,

Acked-by: Martin KaFai Lau <kafai@xxxxxx>