From b1503cda1e78cad4dca522ddbb4c69f4c6869bcd Mon Sep 17 00:00:00 2001 From: malc Date: Mon, 22 Dec 2008 20:33:55 +0000 Subject: Use the ARRAY_SIZE() macro where appropriate. Change from v1: Avoid changing the existing coding style in certain files. Signed-off-by: Stuart Brady git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6120 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/rc4030.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hw/rc4030.c') 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))) { -- cgit 1.4.1