diff options
| author | Ingo Molnar <mingo@elte.hu> | 2009-02-17 14:28:29 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-02-17 14:28:29 -0500 |
| commit | 8316e38100c70cd1443ac90074eccdd033aa218d (patch) | |
| tree | 155392d9a76df31a1934c181d24467cd93294986 | |
| parent | ae88a23b32fa7e0dc9fa7ce735966e68eb41b0bc (diff) | |
irq: further clean up the free_irq() code flow
Linus noticed that the 'pp' variable can be eliminated
altogether, and the loop can be cleaned up further.
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
| -rw-r--r-- | kernel/irq/manage.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 7a954b860c07..de5a765e88ab 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
| @@ -575,7 +575,7 @@ int setup_irq(unsigned int irq, struct irqaction *act) | |||
| 575 | void free_irq(unsigned int irq, void *dev_id) | 575 | void free_irq(unsigned int irq, void *dev_id) |
| 576 | { | 576 | { |
| 577 | struct irq_desc *desc = irq_to_desc(irq); | 577 | struct irq_desc *desc = irq_to_desc(irq); |
| 578 | struct irqaction *action, **p, **pp; | 578 | struct irqaction *action, **p; |
| 579 | unsigned long flags; | 579 | unsigned long flags; |
| 580 | 580 | ||
| 581 | WARN(in_interrupt(), "Trying to free IRQ %d from IRQ context!\n", irq); | 581 | WARN(in_interrupt(), "Trying to free IRQ %d from IRQ context!\n", irq); |
| @@ -592,7 +592,6 @@ void free_irq(unsigned int irq, void *dev_id) | |||
| 592 | p = &desc->action; | 592 | p = &desc->action; |
| 593 | for (;;) { | 593 | for (;;) { |
| 594 | action = *p; | 594 | action = *p; |
| 595 | pp = p; | ||
| 596 | 595 | ||
| 597 | if (!action) { | 596 | if (!action) { |
| 598 | WARN(1, "Trying to free already-free IRQ %d\n", irq); | 597 | WARN(1, "Trying to free already-free IRQ %d\n", irq); |
| @@ -601,15 +600,13 @@ void free_irq(unsigned int irq, void *dev_id) | |||
| 601 | return; | 600 | return; |
| 602 | } | 601 | } |
| 603 | 602 | ||
| 603 | if (action->dev_id == dev_id) | ||
| 604 | break; | ||
| 604 | p = &action->next; | 605 | p = &action->next; |
| 605 | if (action->dev_id != dev_id) | ||
| 606 | continue; | ||
| 607 | |||
| 608 | break; | ||
| 609 | } | 606 | } |
| 610 | 607 | ||
| 611 | /* Found it - now remove it from the list of entries: */ | 608 | /* Found it - now remove it from the list of entries: */ |
| 612 | *pp = action->next; | 609 | *p = action->next; |
| 613 | 610 | ||
| 614 | /* Currently used only by UML, might disappear one day: */ | 611 | /* Currently used only by UML, might disappear one day: */ |
| 615 | #ifdef CONFIG_IRQ_RELEASE_METHOD | 612 | #ifdef CONFIG_IRQ_RELEASE_METHOD |
