diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-08-20 07:50:20 +0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-16 18:52:51 +0400 |
commit | 52b17329d6d0a4824b89206803a430915031ff23 (patch) | |
tree | 714884d90d67a771eef01863a677d502b2d758fc /fs/proc/proc_misc.c | |
parent | a2f9f43858db64cb8b45c4f6746d7a52b80d4dcb (diff) | |
download | linux-52b17329d6d0a4824b89206803a430915031ff23.tar.xz |
x86_64: make /proc/interrupts work with dyn irq_desc
loop with irq_desc list
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/proc/proc_misc.c')
-rw-r--r-- | fs/proc/proc_misc.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index c3cbabe8b38e..72dd739a7f8a 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c @@ -645,15 +645,36 @@ static const struct file_operations proc_stat_operations = { */ static void *int_seq_start(struct seq_file *f, loff_t *pos) { +#ifdef CONFIG_HAVE_SPARSE_IRQ + struct irq_desc *desc; + int irq; + int count = *pos; + + for_each_irq_desc(irq, desc) { + if (count-- == 0) + return desc; + } + + return NULL; +#else return (*pos <= nr_irqs) ? pos : NULL; +#endif } + static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos) { +#ifdef CONFIG_HAVE_SPARSE_IRQ + struct irq_desc *desc; + + desc = ((struct irq_desc *)v)->next; (*pos)++; - if (*pos > nr_irqs) - return NULL; - return pos; + + return desc; +#else + (*pos)++; + return (*pos <= nr_irqs) ? pos : NULL; +#endif } static void int_seq_stop(struct seq_file *f, void *v) @@ -661,7 +682,6 @@ static void int_seq_stop(struct seq_file *f, void *v) /* Nothing to do */ } - static const struct seq_operations int_seq_ops = { .start = int_seq_start, .next = int_seq_next, |