[Qemu-devel] [PATCH 08/11] hw/sparc: use ARRAY_SIZE() macro

Philippe Mathieu-Daudé posted 11 patches 8 years, 9 months ago
Only 10 patches received!
[Qemu-devel] [PATCH 08/11] hw/sparc: use ARRAY_SIZE() macro
Posted by Philippe Mathieu-Daudé 8 years, 9 months ago
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/sparc64/sun4u.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index d347b6616d..525d6f44a0 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -214,7 +214,7 @@ static void isa_irq_handler(void *opaque, int n, int level)
     qemu_irq *irqs = opaque;
     int ivec;
 
-    assert(n < 16);
+    assert(n < ARRAY_SIZE(isa_irq_to_ivec));
     ivec = isa_irq_to_ivec[n];
     EBUS_DPRINTF("Set ISA IRQ %d level %d -> ivec 0x%x\n", n, level, ivec);
     if (ivec) {
-- 
2.11.0


Re: [Qemu-devel] [PATCH 08/11] hw/sparc: use ARRAY_SIZE() macro
Posted by Alex Bennée 8 years, 9 months ago
Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/sparc64/sun4u.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
> index d347b6616d..525d6f44a0 100644
> --- a/hw/sparc64/sun4u.c
> +++ b/hw/sparc64/sun4u.c
> @@ -214,7 +214,7 @@ static void isa_irq_handler(void *opaque, int n, int level)
>      qemu_irq *irqs = opaque;
>      int ivec;
>
> -    assert(n < 16);
> +    assert(n < ARRAY_SIZE(isa_irq_to_ivec));
>      ivec = isa_irq_to_ivec[n];
>      EBUS_DPRINTF("Set ISA IRQ %d level %d -> ivec 0x%x\n", n, level, ivec);
>      if (ivec) {

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

--
Alex Bennée

Re: [Qemu-devel] [PATCH 08/11] hw/sparc: use ARRAY_SIZE() macro
Posted by Michael Tokarev 8 years, 8 months ago
Applied to -trivial, thanks!

/mjt