diff options
author | Yuze Chi <chiyuze@google.com> | 2022-06-03 08:51:56 +0300 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2022-06-04 00:53:33 +0300 |
commit | 611edf1bacc51355ccb497915695db7f869cb382 (patch) | |
tree | bade0a13157b6b851ae2deb564331f02b03e0665 /tools/lib/bpf/libbpf.c | |
parent | e6ff92f41b65fce07365f1066fb13b5e42aca08d (diff) | |
download | linux-611edf1bacc51355ccb497915695db7f869cb382.tar.xz |
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
Diffstat (limited to 'tools/lib/bpf/libbpf.c')
-rw-r--r-- | tools/lib/bpf/libbpf.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 5afe4cbd684f..b03165687936 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -5071,11 +5071,6 @@ bpf_object__populate_internal_map(struct bpf_object *obj, struct bpf_map *map) static void bpf_map__destroy(struct bpf_map *map); -static bool is_pow_of_2(size_t x) -{ - return x && (x & (x - 1)); -} - static size_t adjust_ringbuf_sz(size_t sz) { __u32 page_sz = sysconf(_SC_PAGE_SIZE); |