Messages in this thread | | | Date | Sun, 19 Jun 2022 19:12:48 +0200 | From | Pavel Machek <> | Subject | Re: [PATCH] libbpf: Fix is_pow_of_2 |
| |
Hi!
> From: Yuze Chi <chiyuze@google.com> > > +++ b/tools/lib/bpf/libbpf.c > @@ -4956,7 +4956,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)); > }
I'm pretty sure we have this test in macro in includes somewhere... should we use that instead? Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
| |