mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-03 23:29:06 +08:00
libbpf: Fix is_pow_of_2
Move the correct definition from linker.c into libbpf_internal.h.
Fixes: 0087a681fa8c ("libbpf: Automatically fix up BPF_MAP_TYPE_RINGBUF size, if necessary")
Reported-by: Yuze Chi <chiyuze@google.com>
Signed-off-by: Yuze Chi <chiyuze@google.com>
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220603055156.2830463-1-irogers@google.com
This commit is contained in:
committed by
Andrii Nakryiko
parent
55638904af
commit
ad0783c430
@@ -697,11 +697,6 @@ static int linker_load_obj_file(struct bpf_linker *linker, const char *filename,
|
||||
return err;
|
||||
}
|
||||
|
||||
static bool is_pow_of_2(size_t x)
|
||||
{
|
||||
return x && (x & (x - 1)) == 0;
|
||||
}
|
||||
|
||||
static int linker_sanity_check_elf(struct src_obj *obj)
|
||||
{
|
||||
struct src_sec *sec;
|
||||
|
||||
Reference in New Issue
Block a user