Messages in this thread Patch in this message | | | From | Francis Laniel <> | Subject | [RFC PATCH v1 2/3] do not merge: Temporary fix for is_power_of_2. | Date | Wed, 10 Aug 2022 19:16:53 +0200 |
| |
Signed-off-by: Francis Laniel <flaniel@linux.microsoft.com> --- tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index e89cc9c885b3..5d0e997c85ea 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -4945,7 +4945,7 @@ static void bpf_map__destroy(struct bpf_map *map); static bool is_pow_of_2(size_t x) { - return x && (x & (x - 1)); + return x && (x & (x - 1)) == 0; } static size_t adjust_ringbuf_sz(size_t sz) -- 2.25.1
| |