[PATCH] genirq: cleanup: remove irq_descp()

Cleanup: remove irq_descp() - explicit use of irq_desc[] is shorter and more
readable.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Ingo Molnar 2006-06-29 02:24:38 -07:00 коммит произвёл Linus Torvalds
Родитель a53da52fd7
Коммит a8553acd6c
9 изменённых файлов: 16 добавлений и 23 удалений

Просмотреть файл

@ -44,8 +44,8 @@ hpsim_irq_init (void)
int i; int i;
for (i = 0; i < NR_IRQS; ++i) { for (i = 0; i < NR_IRQS; ++i) {
idesc = irq_descp(i); idesc = irq_desc + i;
if (idesc->handler == &no_irq_type) if (idesc->chip == &no_irq_type)
idesc->handler = &irq_type_hp_sim; idesc->chip = &irq_type_hp_sim;
} }
} }

Просмотреть файл

@ -456,7 +456,7 @@ iosapic_startup_edge_irq (unsigned int irq)
static void static void
iosapic_ack_edge_irq (unsigned int irq) iosapic_ack_edge_irq (unsigned int irq)
{ {
irq_desc_t *idesc = irq_descp(irq); irq_desc_t *idesc = irq_desc + irq;
move_native_irq(irq); move_native_irq(irq);
/* /*
@ -659,7 +659,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
else else
irq_type = &irq_type_iosapic_level; irq_type = &irq_type_iosapic_level;
idesc = irq_descp(vector); idesc = irq_desc + vector;
if (idesc->chip != irq_type) { if (idesc->chip != irq_type) {
if (idesc->chip != &no_irq_type) if (idesc->chip != &no_irq_type)
printk(KERN_WARNING printk(KERN_WARNING
@ -793,14 +793,14 @@ again:
return -ENOSPC; return -ENOSPC;
} }
spin_lock_irqsave(&irq_descp(vector)->lock, flags); spin_lock_irqsave(&irq_desc[vector].lock, flags);
spin_lock(&iosapic_lock); spin_lock(&iosapic_lock);
{ {
if (gsi_to_vector(gsi) > 0) { if (gsi_to_vector(gsi) > 0) {
if (list_empty(&iosapic_intr_info[vector].rtes)) if (list_empty(&iosapic_intr_info[vector].rtes))
free_irq_vector(vector); free_irq_vector(vector);
spin_unlock(&iosapic_lock); spin_unlock(&iosapic_lock);
spin_unlock_irqrestore(&irq_descp(vector)->lock, spin_unlock_irqrestore(&irq_desc[vector].lock,
flags); flags);
goto again; goto again;
} }
@ -810,7 +810,7 @@ again:
polarity, trigger); polarity, trigger);
if (err < 0) { if (err < 0) {
spin_unlock(&iosapic_lock); spin_unlock(&iosapic_lock);
spin_unlock_irqrestore(&irq_descp(vector)->lock, spin_unlock_irqrestore(&irq_desc[vector].lock,
flags); flags);
return err; return err;
} }
@ -825,7 +825,7 @@ again:
set_rte(gsi, vector, dest, mask); set_rte(gsi, vector, dest, mask);
} }
spin_unlock(&iosapic_lock); spin_unlock(&iosapic_lock);
spin_unlock_irqrestore(&irq_descp(vector)->lock, flags); spin_unlock_irqrestore(&irq_desc[vector].lock, flags);
printk(KERN_INFO "GSI %u (%s, %s) -> CPU %d (0x%04x) vector %d\n", printk(KERN_INFO "GSI %u (%s, %s) -> CPU %d (0x%04x) vector %d\n",
gsi, (trigger == IOSAPIC_EDGE ? "edge" : "level"), gsi, (trigger == IOSAPIC_EDGE ? "edge" : "level"),
@ -860,7 +860,7 @@ iosapic_unregister_intr (unsigned int gsi)
} }
vector = irq_to_vector(irq); vector = irq_to_vector(irq);
idesc = irq_descp(irq); idesc = irq_desc + irq;
spin_lock_irqsave(&idesc->lock, flags); spin_lock_irqsave(&idesc->lock, flags);
spin_lock(&iosapic_lock); spin_lock(&iosapic_lock);
{ {

Просмотреть файл

@ -120,7 +120,7 @@ static void migrate_irqs(void)
int irq, new_cpu; int irq, new_cpu;
for (irq=0; irq < NR_IRQS; irq++) { for (irq=0; irq < NR_IRQS; irq++) {
desc = irq_descp(irq); desc = irq_desc + irq;
/* /*
* No handling for now. * No handling for now.

Просмотреть файл

@ -249,7 +249,7 @@ register_percpu_irq (ia64_vector vec, struct irqaction *action)
for (irq = 0; irq < NR_IRQS; ++irq) for (irq = 0; irq < NR_IRQS; ++irq)
if (irq_to_vector(irq) == vec) { if (irq_to_vector(irq) == vec) {
desc = irq_descp(irq); desc = irq_desc + irq;
desc->status |= IRQ_PER_CPU; desc->status |= IRQ_PER_CPU;
desc->chip = &irq_type_ia64_lsapic; desc->chip = &irq_type_ia64_lsapic;
if (action) if (action)

Просмотреть файл

@ -1788,7 +1788,7 @@ ia64_mca_late_init(void)
cpe_poll_enabled = 0; cpe_poll_enabled = 0;
for (irq = 0; irq < NR_IRQS; ++irq) for (irq = 0; irq < NR_IRQS; ++irq)
if (irq_to_vector(irq) == cpe_vector) { if (irq_to_vector(irq) == cpe_vector) {
desc = irq_descp(irq); desc = irq_desc + irq;
desc->status |= IRQ_PER_CPU; desc->status |= IRQ_PER_CPU;
setup_irq(irq, &mca_cpe_irqaction); setup_irq(irq, &mca_cpe_irqaction);
ia64_cpe_irq = irq; ia64_cpe_irq = irq;

Просмотреть файл

@ -677,7 +677,7 @@ int migrate_platform_irqs(unsigned int cpu)
new_cpei_cpu = any_online_cpu(cpu_online_map); new_cpei_cpu = any_online_cpu(cpu_online_map);
mask = cpumask_of_cpu(new_cpei_cpu); mask = cpumask_of_cpu(new_cpei_cpu);
set_cpei_target_cpu(new_cpei_cpu); set_cpei_target_cpu(new_cpei_cpu);
desc = irq_descp(ia64_cpe_irq); desc = irq_desc + ia64_cpe_irq;
/* /*
* Switch for now, immediatly, we need to do fake intr * Switch for now, immediatly, we need to do fake intr
* as other interrupts, but need to study CPEI behaviour with * as other interrupts, but need to study CPEI behaviour with

Просмотреть файл

@ -190,7 +190,7 @@ void default_machine_crash_shutdown(struct pt_regs *regs)
local_irq_disable(); local_irq_disable();
for_each_irq(irq) { for_each_irq(irq) {
struct irq_desc *desc = irq_descp(irq); struct irq_desc *desc = irq_desc + irq;
if (desc->status & IRQ_INPROGRESS) if (desc->status & IRQ_INPROGRESS)
desc->chip->end(irq); desc->chip->end(irq);

Просмотреть файл

@ -87,13 +87,6 @@ typedef struct irq_desc {
extern irq_desc_t irq_desc [NR_IRQS]; extern irq_desc_t irq_desc [NR_IRQS];
/* Return a pointer to the irq descriptor for IRQ. */
static inline irq_desc_t *
irq_descp (int irq)
{
return irq_desc + irq;
}
#include <asm/hw_irq.h> /* the arch dependent stuff */ #include <asm/hw_irq.h> /* the arch dependent stuff */
extern int setup_irq(unsigned int irq, struct irqaction * new); extern int setup_irq(unsigned int irq, struct irqaction * new);

Просмотреть файл

@ -15,7 +15,7 @@ void set_pending_irq(unsigned int irq, cpumask_t mask)
void move_native_irq(int irq) void move_native_irq(int irq)
{ {
cpumask_t tmp; cpumask_t tmp;
irq_desc_t *desc = irq_descp(irq); irq_desc_t *desc = irq_desc + irq;
if (likely(!desc->move_irq)) if (likely(!desc->move_irq))
return; return;