Commit 6554f5c0 authored by Peter Maydell's avatar Peter Maydell
Browse files

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: default avatarPeter Maydell <peter.maydell@linaro.org>
Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Message-id: 1437741192-20955-5-git-send-email-peter.maydell@linaro.org
parent 26efcec1
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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;
}