diff options
author | Richard Henderson <rth@twiddle.net> | 2013-02-13 17:47:36 -0800 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2013-02-16 11:11:34 +0000 |
commit | 18331e7c189507513008a2936f5fe79c3d8b8a08 (patch) | |
tree | d29a74fa9fbab380a6770c4a8181786111f13fbb /util | |
parent | 72d81155d0b88ba757c5a972d3fff83027e7a6e7 (diff) | |
download | qemu-18331e7c189507513008a2936f5fe79c3d8b8a08.tar.gz qemu-18331e7c189507513008a2936f5fe79c3d8b8a08.tar.bz2 qemu-18331e7c189507513008a2936f5fe79c3d8b8a08.zip |
hbitmap: Use non-bitops ctzl
Both uses of ctz have already eliminated zero, and thus the difference
in edge conditions between the two routines is irrelevant.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'util')
-rw-r--r-- | util/hbitmap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/util/hbitmap.c b/util/hbitmap.c index a0df5d3591..d93683128b 100644 --- a/util/hbitmap.c +++ b/util/hbitmap.c @@ -126,7 +126,8 @@ unsigned long hbitmap_iter_skip_words(HBitmapIter *hbi) * The index of this word's least significant set bit provides * the low-order bits. */ - pos = (pos << BITS_PER_LEVEL) + bitops_ctzl(cur); + assert(cur); + pos = (pos << BITS_PER_LEVEL) + ctzl(cur); hbi->cur[i] = cur & (cur - 1); /* Set up next level for iteration. */ |