提交 8316e381 编写于 作者: I Ingo Molnar

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: NIngo Molnar <mingo@elte.hu>
上级 ae88a23b
...@@ -575,7 +575,7 @@ int setup_irq(unsigned int irq, struct irqaction *act) ...@@ -575,7 +575,7 @@ int setup_irq(unsigned int irq, struct irqaction *act)
void free_irq(unsigned int irq, void *dev_id) void free_irq(unsigned int irq, void *dev_id)
{ {
struct irq_desc *desc = irq_to_desc(irq); struct irq_desc *desc = irq_to_desc(irq);
struct irqaction *action, **p, **pp; struct irqaction *action, **p;
unsigned long flags; unsigned long flags;
WARN(in_interrupt(), "Trying to free IRQ %d from IRQ context!\n", irq); 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,7 +592,6 @@ void free_irq(unsigned int irq, void *dev_id)
p = &desc->action; p = &desc->action;
for (;;) { for (;;) {
action = *p; action = *p;
pp = p;
if (!action) { if (!action) {
WARN(1, "Trying to free already-free IRQ %d\n", irq); 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,15 +600,13 @@ void free_irq(unsigned int irq, void *dev_id)
return; return;
} }
if (action->dev_id == dev_id)
break;
p = &action->next; p = &action->next;
if (action->dev_id != dev_id)
continue;
break;
} }
/* Found it - now remove it from the list of entries: */ /* Found it - now remove it from the list of entries: */
*pp = action->next; *p = action->next;
/* Currently used only by UML, might disappear one day: */ /* Currently used only by UML, might disappear one day: */
#ifdef CONFIG_IRQ_RELEASE_METHOD #ifdef CONFIG_IRQ_RELEASE_METHOD
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册