Skip to content

Commit b171f71

Browse files
committed
genirq/manage: Rework irq_percpu_is_enabled()
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 508bd94 commit b171f71

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

kernel/irq/manage.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2322,19 +2322,9 @@ void enable_percpu_nmi(unsigned int irq, unsigned int type)
23222322
*/
23232323
bool irq_percpu_is_enabled(unsigned int irq)
23242324
{
2325-
unsigned int cpu = smp_processor_id();
2326-
struct irq_desc *desc;
2327-
unsigned long flags;
2328-
bool is_enabled;
2329-
2330-
desc = irq_get_desc_lock(irq, &flags, IRQ_GET_DESC_CHECK_PERCPU);
2331-
if (!desc)
2332-
return false;
2333-
2334-
is_enabled = cpumask_test_cpu(cpu, desc->percpu_enabled);
2335-
irq_put_desc_unlock(desc, flags);
2336-
2337-
return is_enabled;
2325+
scoped_irqdesc_get_and_lock(irq, IRQ_GET_DESC_CHECK_PERCPU)
2326+
return cpumask_test_cpu(smp_processor_id(), scoped_irqdesc->percpu_enabled);
2327+
return false;
23382328
}
23392329
EXPORT_SYMBOL_GPL(irq_percpu_is_enabled);
23402330

0 commit comments

Comments
 (0)