Skip to content

Commit f4dd946

Browse files
bvanasscheKAGA-KOKO
authored andcommitted
fs/procfs: Switch to irq_get_nr_irqs()
Use the irq_get_nr_irqs() function instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 3e48fa2 commit f4dd946

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

fs/proc/interrupts.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
*/
1212
static void *int_seq_start(struct seq_file *f, loff_t *pos)
1313
{
14-
return (*pos <= nr_irqs) ? pos : NULL;
14+
return *pos <= irq_get_nr_irqs() ? pos : NULL;
1515
}
1616

1717
static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos)
1818
{
1919
(*pos)++;
20-
if (*pos > nr_irqs)
20+
if (*pos > irq_get_nr_irqs())
2121
return NULL;
2222
return pos;
2323
}

fs/proc/stat.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static void show_all_irqs(struct seq_file *p)
7676
seq_put_decimal_ull(p, " ", kstat_irqs_usr(i));
7777
next = i + 1;
7878
}
79-
show_irq_gap(p, nr_irqs - next);
79+
show_irq_gap(p, irq_get_nr_irqs() - next);
8080
}
8181

8282
static int show_stat(struct seq_file *p, void *v)
@@ -196,7 +196,7 @@ static int stat_open(struct inode *inode, struct file *file)
196196
unsigned int size = 1024 + 128 * num_online_cpus();
197197

198198
/* minimum size to display an interrupt count : 2 bytes */
199-
size += 2 * nr_irqs;
199+
size += 2 * irq_get_nr_irqs();
200200
return single_open_size(file, show_stat, NULL, size);
201201
}
202202

0 commit comments

Comments
 (0)