diff options
author | Richard Henderson <rth@twiddle.net> | 2013-02-13 17:47:38 -0800 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2013-02-16 11:12:13 +0000 |
commit | 5bbf90be97203c472f47da070c0040b464c0460f (patch) | |
tree | 65279c3c79ddeabf76d11f9e8330a25a0ead887d /memory.c | |
parent | 265ce4a5ca39fb7f74a803dd61bbd9108ca6cdee (diff) |
memory: Use non-bitops ctzl
A memory size of zero is invalid, and so that edge condition
does not occur.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'memory.c')
-rw-r--r-- | memory.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -855,7 +855,7 @@ static uint64_t memory_region_dispatch_read1(MemoryRegion *mr, } if (!mr->ops->read) { - return mr->ops->old_mmio.read[bitops_ctzl(size)](mr->opaque, addr); + return mr->ops->old_mmio.read[ctz32(size)](mr->opaque, addr); } /* FIXME: support unaligned access */ @@ -908,7 +908,7 @@ static void memory_region_dispatch_write(MemoryRegion *mr, adjust_endianness(mr, &data, size); if (!mr->ops->write) { - mr->ops->old_mmio.write[bitops_ctzl(size)](mr->opaque, addr, data); + mr->ops->old_mmio.write[ctz32(size)](mr->opaque, addr, data); return; } |