]> xenbits.xensource.com Git - xen.git/commitdiff
xen/arm: domain_builder: irq sanity check logic fix
authorStewart Hildebrand <Stewart.Hildebrand@dornerworks.com>
Tue, 28 Nov 2017 14:42:03 +0000 (14:42 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 28 Nov 2017 19:27:14 +0000 (11:27 -0800)
It's not possible for an irq to be both below 16 and greater/equal than 32.
Also fix the reference to linux documentation while we're at it.

Signed-off-by: Stewart Hildebrand <stewart.hildebrand@dornerworks.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Release-acked-by: Julien Grall <julien.grall@linaro.org>
xen/arch/arm/domain_build.c

index c74f4dd69d6b9667ceba129a259ea1bbcaea7a80..f50f8b9a2651fd91444c6486fec07b961fa420c7 100644 (file)
@@ -501,9 +501,10 @@ static void set_interrupt_ppi(gic_interrupt_t interrupt, unsigned int irq,
 {
     __be32 *cells = interrupt;
 
-    BUG_ON(irq < 16 && irq >= 32);
+    BUG_ON(irq < 16);
+    BUG_ON(irq >= 32);
 
-    /* See linux Documentation/devictree/bindings/arm/gic.txt */
+    /* See linux Documentation/devicetree/bindings/interrupt-controller/arm,gic.txt */
     dt_set_cell(&cells, 1, 1); /* is a PPI */
     dt_set_cell(&cells, 1, irq - 16); /* PPIs start at 16 */
     dt_set_cell(&cells, 1, (cpumask << 8) | level);