Skip to content

Commit 5fec6d5

Browse files
committed
genirq/manage: Rework teardown_percpu_nmi()
Use the new guards to get and lock the interrupt descriptor and tidy up the code. No functional change. Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 65dd1f7 commit 5fec6d5

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

kernel/irq/manage.c

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2634,22 +2634,13 @@ int prepare_percpu_nmi(unsigned int irq)
26342634
*/
26352635
void teardown_percpu_nmi(unsigned int irq)
26362636
{
2637-
unsigned long flags;
2638-
struct irq_desc *desc;
2639-
26402637
WARN_ON(preemptible());
26412638

2642-
desc = irq_get_desc_lock(irq, &flags,
2643-
IRQ_GET_DESC_CHECK_PERCPU);
2644-
if (!desc)
2645-
return;
2646-
2647-
if (WARN_ON(!irq_is_nmi(desc)))
2648-
goto out;
2649-
2650-
irq_nmi_teardown(desc);
2651-
out:
2652-
irq_put_desc_unlock(desc, flags);
2639+
scoped_irqdesc_get_and_lock(irq, IRQ_GET_DESC_CHECK_PERCPU) {
2640+
if (WARN_ON(!irq_is_nmi(scoped_irqdesc)))
2641+
return;
2642+
irq_nmi_teardown(scoped_irqdesc);
2643+
}
26532644
}
26542645

26552646
static int __irq_get_irqchip_state(struct irq_data *data, enum irqchip_irq_state which, bool *state)

0 commit comments

Comments
 (0)