summary refs log tree commit diff stats
path: root/hw/rc4030.c
diff options
context:
space:
mode:
authormalc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-22 20:33:55 +0000
committermalc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-22 20:33:55 +0000
commitb1503cda1e78cad4dca522ddbb4c69f4c6869bcd (patch)
tree26edd30543fcb27ae90f8762558ea878df42ec57 /hw/rc4030.c
parent5626b017d623cb88d973b53bca11613c766b1715 (diff)
downloadfocaccia-qemu-b1503cda1e78cad4dca522ddbb4c69f4c6869bcd.tar.gz
focaccia-qemu-b1503cda1e78cad4dca522ddbb4c69f4c6869bcd.zip
Use the ARRAY_SIZE() macro where appropriate.
Change from v1:
  Avoid changing the existing coding style in certain files.

Signed-off-by: Stuart Brady <stuart.brady@gmail.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6120 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/rc4030.c')
-rw-r--r--hw/rc4030.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/rc4030.c b/hw/rc4030.c
index 54f9adfa3e..89cec6e3bb 100644
--- a/hw/rc4030.c
+++ b/hw/rc4030.c
@@ -269,7 +269,7 @@ static void rc4030_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
             static int current = 0;
             target_phys_addr_t dest = 0 + dests[current];
             uint8_t buf;
-            current = (current + 1) % (sizeof(dests)/sizeof(dests[0]));
+            current = (current + 1) % (ARRAY_SIZE(dests));
             buf = s->cache_bwin - 1;
             cpu_physical_memory_rw(dest, &buf, 1, 1);
         }
@@ -403,7 +403,7 @@ static void update_jazz_irq(rc4030State *s)
     if (s->isr_jazz != 0) {
         uint32_t irq = 0;
         printf("jazz pending:");
-        for (irq = 0; irq < sizeof(irq_names)/sizeof(irq_names[0]); irq++) {
+        for (irq = 0; irq < ARRAY_SIZE(irq_names); irq++) {
             if (s->isr_jazz & (1 << irq)) {
                 printf(" %s", irq_names[irq]);
                 if (!(s->imr_jazz & (1 << irq))) {