diff options
| author | Peter Maydell | 2015-07-24 14:33:10 +0200 |
|---|---|---|
| committer | Peter Maydell | 2015-09-07 15:19:00 +0200 |
| commit | 6554f5c03793bb8a3d5dedcebf758a1694fa186c (patch) | |
| tree | 3a88b2862a1dd6454fbd4a82cd376fd05c3392e0 /exec.c | |
| parent | hw/block/nvme.c: Use pow2ceil() rather than hand-calculation (diff) | |
| download | qemu-6554f5c03793bb8a3d5dedcebf758a1694fa186c.tar.gz qemu-6554f5c03793bb8a3d5dedcebf758a1694fa186c.tar.xz qemu-6554f5c03793bb8a3d5dedcebf758a1694fa186c.zip | |
exec.c: Use pow2floor() rather than hand-calculation
Use pow2floor() to round down to the nearest power of 2,
rather than an inline calculation.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1437741192-20955-5-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'exec.c')
| -rw-r--r-- | exec.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -2374,9 +2374,7 @@ static int memory_access_size(MemoryRegion *mr, unsigned l, hwaddr addr) if (l > access_size_max) { l = access_size_max; } - if (l & (l - 1)) { - l = 1 << (qemu_fls(l) - 1); - } + l = pow2floor(l); return l; } |
