[xen master] ARM: vGIC: fix nr_irq definition

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[xen master] ARM: vGIC: fix nr_irq definition

commit b819187a15ecea7fe00cffded1bf454b8a6d7dd2
Author:     Andre Przywara <[hidden email]>
AuthorDate: Thu Oct 19 13:48:37 2017 +0100
Commit:     Stefano Stabellini <[hidden email]>
CommitDate: Fri Dec 8 13:14:47 2017 -0800

    ARM: vGIC: fix nr_irq definition
    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 <[hidden email]>
 xen/arch/arm/irq.c        | 2 ++
 xen/include/asm-arm/irq.h | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index cbc7e6e..7f133de 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -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);
diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
index 2de76d0..abc8f06 100644
--- a/xen/include/asm-arm/irq.h
+++ b/xen/include/asm-arm/irq.h
@@ -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
generated by git-patchbot for /home/xen/git/xen.git#master

Xen-changelog mailing list
[hidden email]