Skip to content

Commit

Permalink
genirq: Pass desc to __irq_free instead of irq number
Browse files Browse the repository at this point in the history
Given that irq_to_desc() is a radix_tree_lookup and the reverse
operation is only a pointer dereference and that all callers of
__free_irq already have the desc, pass the desc instead of the irq
number.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: kernel@pengutronix.de
Link: https://lkml.kernel.org/r/20180319105202.9794-1-u.kleine-koenig@pengutronix.de
  • Loading branch information
Uwe Kleine König authored and Thomas Gleixner committed Mar 20, 2018
1 parent cc6c984 commit 83ac4ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kernel/irq/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -1523,9 +1523,9 @@ EXPORT_SYMBOL_GPL(setup_irq);
* Internal function to unregister an irqaction - used to free
* regular and special interrupts that are part of the architecture.
*/
static struct irqaction *__free_irq(unsigned int irq, void *dev_id)
static struct irqaction *__free_irq(struct irq_desc *desc, void *dev_id)
{
struct irq_desc *desc = irq_to_desc(irq);
unsigned irq = desc->irq_data.irq;
struct irqaction *action, **action_ptr;
unsigned long flags;

Expand Down Expand Up @@ -1655,7 +1655,7 @@ void remove_irq(unsigned int irq, struct irqaction *act)
struct irq_desc *desc = irq_to_desc(irq);

if (desc && !WARN_ON(irq_settings_is_per_cpu_devid(desc)))
__free_irq(irq, act->dev_id);
__free_irq(desc, act->dev_id);
}
EXPORT_SYMBOL_GPL(remove_irq);

Expand Down Expand Up @@ -1689,7 +1689,7 @@ const void *free_irq(unsigned int irq, void *dev_id)
desc->affinity_notify = NULL;
#endif

action = __free_irq(irq, dev_id);
action = __free_irq(desc, dev_id);

if (!action)
return NULL;
Expand Down

0 comments on commit 83ac4ca

Please sign in to comment.