Skip to content

Commit

Permalink
genirq: consolidate nr_irqs and for_each_irq_desc()
Browse files Browse the repository at this point in the history
Move all of those to linux/irq.h where they belong.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed Oct 16, 2008
1 parent 3235e93 commit 70dd4d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
9 changes: 0 additions & 9 deletions include/linux/interrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@
#include <asm/ptrace.h>
#include <asm/system.h>

#ifndef CONFIG_GENERIC_HARDIRQS
# define for_each_irq_desc(irq, desc) \
for (irq = 0; irq < nr_irqs; irq++)

# define nr_irqs NR_IRQS
#else
extern int nr_irqs;
#endif

/*
* These correspond to the IORESOURCE_IRQ_* defines in
* linux/ioport.h to select the interrupt line behaviour. When
Expand Down
17 changes: 12 additions & 5 deletions include/linux/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@

#include <linux/smp.h>

#ifndef CONFIG_GENERIC_HARDIRQS
# define nr_irqs NR_IRQS

# define for_each_irq_desc(irq, desc) \
for (irq = 0; irq < nr_irqs; irq++)
#else
extern int nr_irqs;

# define for_each_irq_desc(irq, desc) \
for (irq = 0, desc = irq_desc; irq < nr_irqs; irq++, desc++)
#endif

#ifndef CONFIG_S390

#include <linux/linkage.h>
Expand Down Expand Up @@ -204,11 +216,6 @@ extern struct irq_desc irq_desc[NR_IRQS];
extern struct irq_desc *irq_desc;
#endif

#ifdef CONFIG_GENERIC_HARDIRQS
#define for_each_irq_desc(irq, desc) \
for (irq = 0, desc = irq_desc; irq < nr_irqs; irq++, desc = &irq_desc[irq])
#endif

#else

extern struct irq_desc *sparse_irqs;
Expand Down

0 comments on commit 70dd4d9

Please sign in to comment.