Patchwork [05/10] memory: Use non-bitops ctzl

login
register
mail settings
Submitter Richard Henderson
Date Feb. 14, 2013, 1:47 a.m.
Message ID <1360806463-23632-6-git-send-email-rth@twiddle.net>
Download mbox | patch
Permalink /patch/220317/
State New
Headers show

Comments

Richard Henderson - Feb. 14, 2013, 1:47 a.m.
A memory size of zero is invalid, and so that edge condition
does not occur.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 memory.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/memory.c b/memory.c
index cd7d5e0..92a2196 100644
--- a/memory.c
+++ b/memory.c
@@ -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;
     }