summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy2019-01-16 00:26:50 +0100
committerJohn Snow2019-01-16 00:26:50 +0100
commit19c021e1948a81c4ba19b3ff735432b45b6aebee (patch)
treeae8e1fb0b4d5d053de932f48d9958261913b1a81 /util
parentRevert "test-hbitmap: Add non-advancing iter_next tests" (diff)
downloadqemu-19c021e1948a81c4ba19b3ff735432b45b6aebee.tar.gz
qemu-19c021e1948a81c4ba19b3ff735432b45b6aebee.tar.xz
qemu-19c021e1948a81c4ba19b3ff735432b45b6aebee.zip
Revert "hbitmap: Add @advance param to hbitmap_iter_next()"
This reverts commit a33fbb4f8b64226becf502a123733776ce319b24. The functionality is unused. Note: in addition to automatic revert, drop second parameter in hbitmap_iter_next() call from hbitmap_next_dirty_area() too. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'util')
-rw-r--r--util/hbitmap.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/util/hbitmap.c b/util/hbitmap.c
index fa356522c4..7905212a8b 100644
--- a/util/hbitmap.c
+++ b/util/hbitmap.c
@@ -144,7 +144,7 @@ unsigned long hbitmap_iter_skip_words(HBitmapIter *hbi)
return cur;
}
-int64_t hbitmap_iter_next(HBitmapIter *hbi, bool advance)
+int64_t hbitmap_iter_next(HBitmapIter *hbi)
{
unsigned long cur = hbi->cur[HBITMAP_LEVELS - 1] &
hbi->hb->levels[HBITMAP_LEVELS - 1][hbi->pos];
@@ -157,12 +157,8 @@ int64_t hbitmap_iter_next(HBitmapIter *hbi, bool advance)
}
}
- if (advance) {
- /* The next call will resume work from the next bit. */
- hbi->cur[HBITMAP_LEVELS - 1] = cur & (cur - 1);
- } else {
- hbi->cur[HBITMAP_LEVELS - 1] = cur;
- }
+ /* 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) + ctzl(cur);
return item << hbi->granularity;
@@ -261,7 +257,7 @@ bool hbitmap_next_dirty_area(const HBitmap *hb, uint64_t *start,
end = *count > hb->orig_size - *start ? hb->orig_size : *start + *count;
hbitmap_iter_init(&hbi, hb, *start);
- firt_dirty_off = hbitmap_iter_next(&hbi, false);
+ firt_dirty_off = hbitmap_iter_next(&hbi);
if (firt_dirty_off < 0 || firt_dirty_off >= end) {
return false;