diff options
author | Bart Van Assche <bvanassche@acm.org> | 2024-10-15 12:09:52 -0700 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2024-10-16 21:56:59 +0200 |
commit | 1ad2048bf7146efb83bc033147ca1611a7fe8494 (patch) | |
tree | af3b86fae07871cfe8d621d777bf9cd23f942360 /kernel/irq/proc.c | |
parent | f4dd946c775e85e4f9aa460cd3dba197c35e43f1 (diff) |
genirq: Switch to irq_get_nr_irqs()
Use the irq_get_nr_irqs() function instead of the global variable
'nr_irqs'. Cache the result of this function in a local variable in
order not to rely on CSE (common subexpression elimination). Prepare
for changing 'nr_irqs' from an exported global variable into a variable
with file scope.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20241015190953.1266194-22-bvanassche@acm.org
Diffstat (limited to 'kernel/irq/proc.c')
-rw-r--r-- | kernel/irq/proc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index 9081ada81c3d..d226282c5b66 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c @@ -457,11 +457,12 @@ int __weak arch_show_interrupts(struct seq_file *p, int prec) } #ifndef ACTUAL_NR_IRQS -# define ACTUAL_NR_IRQS nr_irqs +# define ACTUAL_NR_IRQS irq_get_nr_irqs() #endif int show_interrupts(struct seq_file *p, void *v) { + const unsigned int nr_irqs = irq_get_nr_irqs(); static int prec; int i = *(loff_t *) v, j; |