ARM: vGIC: fix nr_irq definition
authorAndre Przywara <andre.przywara@arm.com>
Thu, 19 Oct 2017 12:48:37 +0000 (13:48 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 8 Dec 2017 21:14:47 +0000 (13:14 -0800)
The global variable "nr_irqs" is used for x86 and some common Xen code.
To make the latter work easily for ARM, it was #defined to NR_IRQS.
This not only violated the common habit of capitalizing macros, but
also caused issues if one wanted to use a rather innocent "nr_irqs" as
a local variable name or as a function parameter.
Drop the optimization and make nr_irqs a normal variable for ARM also.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
xen/arch/arm/irq.c
xen/include/asm-arm/irq.h

index cbc7e6ebb8fe6ccf49d2f0f6982214676b1c7fd6..7f133de54907b323a68d4791c1ceab5986713a82 100644 (file)
@@ -27,6 +27,8 @@
 #include <asm/gic.h>
 #include <asm/vgic.h>
 
+unsigned int __read_mostly nr_irqs = NR_IRQS;
+
 static unsigned int local_irqs_type[NR_LOCAL_IRQS];
 static DEFINE_SPINLOCK(local_irqs_type_lock);
 
index 2de76d0f56af6497d8a44eb1bcd04e4f74e197ba..abc8f06a13ae902eec312c8944d0517322c078c0 100644 (file)
@@ -31,7 +31,7 @@ struct arch_irq_desc {
 /* LPIs are always numbered starting at 8192, so 0 is a good invalid case. */
 #define INVALID_LPI     0
 
-#define nr_irqs NR_IRQS
+extern unsigned int nr_irqs;
 #define nr_static_irqs NR_IRQS
 #define arch_hwdom_irqs(domid) NR_IRQS