Skip to content

Commit

Permalink
sparseirq: fix Alpha build failure
Browse files Browse the repository at this point in the history
Impact: build fix on Alpha

-tip testing found this build failure on the Alpha defconfig:

/home/mingo/tip/fs/proc/stat.c: In function 'show_stat':
/home/mingo/tip/fs/proc/stat.c:48: error: implicit declaration of function 'for_each_irq_desc'
/home/mingo/tip/fs/proc/stat.c:48: error: expected ';' before '{' token

can not use irq_desc() in stat.c on older architectures.

Signed-off-by: Yinghai Lu <yinghai@kernel.orgg>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Dec 9, 2008
1 parent 50dd94e commit 240d367
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 19 deletions.
20 changes: 13 additions & 7 deletions fs/proc/stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ static int show_stat(struct seq_file *p, void *v)
softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq);
steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal);
guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest);
for_each_irq_desc(j, desc) {
for_each_irq_nr(j) {
#ifdef CONFIG_SPARSE_IRQ
desc = irq_to_desc(j);
if (!desc)
continue;
#endif
sum += kstat_irqs_cpu(j, i);
}
sum += arch_irq_stat_cpu(i);
Expand Down Expand Up @@ -92,14 +95,17 @@ static int show_stat(struct seq_file *p, void *v)
seq_printf(p, "intr %llu", (unsigned long long)sum);

/* sum again ? it could be updated? */
for (j = 0; j < NR_IRQS; j++) {
desc = irq_to_desc(j);
for_each_irq_nr(j) {
per_irq_sum = 0;

if (desc) {
for_each_possible_cpu(i)
per_irq_sum += kstat_irqs_cpu(j, i);
#ifdef CONFIG_SPARSE_IRQ
desc = irq_to_desc(j);
if (!desc) {
seq_printf(p, " %u", per_irq_sum);
continue;
}
#endif
for_each_possible_cpu(i)
per_irq_sum += kstat_irqs_cpu(j, i);

seq_printf(p, " %u", per_irq_sum);
}
Expand Down
9 changes: 0 additions & 9 deletions include/linux/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ extern void arch_init_copy_chip_data(struct irq_desc *old_desc,
extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc);

#ifndef CONFIG_SPARSE_IRQ

extern struct irq_desc irq_desc[NR_IRQS];

static inline struct irq_desc *irq_to_desc(unsigned int irq)
Expand All @@ -210,14 +209,6 @@ static inline struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu)
return irq_to_desc(irq);
}

#ifdef CONFIG_GENERIC_HARDIRQS
# define for_each_irq_desc(irq, desc) \
for (irq = 0, desc = irq_desc; irq < nr_irqs; irq++, desc++)
# define for_each_irq_desc_reverse(irq, desc) \
for (irq = nr_irqs - 1, desc = irq_desc + (nr_irqs - 1); \
irq >= 0; irq--, desc--)
#endif

#else

extern struct irq_desc *irq_to_desc(unsigned int irq);
Expand Down
19 changes: 16 additions & 3 deletions include/linux/irqnr.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,22 @@
# define for_each_irq_desc(irq, desc) \
for (irq = 0; irq < nr_irqs; irq++)

static inline early_sparse_irq_init(void)
{
}
# define for_each_irq_desc_reverse(irq, desc) \
for (irq = nr_irqs - 1; irq >= 0; irq--)
#else
#ifndef CONFIG_SPARSE_IRQ

struct irq_desc;
extern int nr_irqs;
# define for_each_irq_desc(irq, desc) \
for (irq = 0, desc = irq_desc; irq < nr_irqs; irq++, desc++)
# define for_each_irq_desc_reverse(irq, desc) \
for (irq = nr_irqs - 1, desc = irq_desc + (nr_irqs - 1); \
irq >= 0; irq--, desc--)
#endif
#endif

#define for_each_irq_nr(irq) \
for (irq = 0; irq < nr_irqs; irq++)

#endif

0 comments on commit 240d367

Please sign in to comment.