aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2013-02-13 17:47:36 -0800
committerBlue Swirl <blauwirbel@gmail.com>2013-02-16 11:11:34 +0000
commit18331e7c189507513008a2936f5fe79c3d8b8a08 (patch)
treed29a74fa9fbab380a6770c4a8181786111f13fbb /include
parent72d81155d0b88ba757c5a972d3fff83027e7a6e7 (diff)
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 'include')
-rw-r--r--include/qemu/hbitmap.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/qemu/hbitmap.h b/include/qemu/hbitmap.h
index 250de03b03..550d7ce2c3 100644
--- a/include/qemu/hbitmap.h
+++ b/include/qemu/hbitmap.h
@@ -16,6 +16,7 @@
#include <stdint.h>
#include <stdbool.h>
#include "bitops.h"
+#include "host-utils.h"
typedef struct HBitmap HBitmap;
typedef struct HBitmapIter HBitmapIter;
@@ -170,7 +171,7 @@ static inline int64_t hbitmap_iter_next(HBitmapIter *hbi)
/* The next call will resume work from the next bit. */
hbi->cur[HBITMAP_LEVELS - 1] = cur & (cur - 1);
- item = ((uint64_t)hbi->pos << BITS_PER_LEVEL) + bitops_ctzl(cur);
+ item = ((uint64_t)hbi->pos << BITS_PER_LEVEL) + ctzl(cur);
return item << hbi->granularity;
}