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 <tglx@linutronix.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/all/20250429065422.376836282@linutronix.depull/1250/head
parent
508bd94c3a
commit
b171f712d6
|
|
@ -2322,19 +2322,9 @@ void enable_percpu_nmi(unsigned int irq, unsigned int type)
|
|||
*/
|
||||
bool irq_percpu_is_enabled(unsigned int irq)
|
||||
{
|
||||
unsigned int cpu = smp_processor_id();
|
||||
struct irq_desc *desc;
|
||||
unsigned long flags;
|
||||
bool is_enabled;
|
||||
|
||||
desc = irq_get_desc_lock(irq, &flags, IRQ_GET_DESC_CHECK_PERCPU);
|
||||
if (!desc)
|
||||
return false;
|
||||
|
||||
is_enabled = cpumask_test_cpu(cpu, desc->percpu_enabled);
|
||||
irq_put_desc_unlock(desc, flags);
|
||||
|
||||
return is_enabled;
|
||||
scoped_irqdesc_get_and_lock(irq, IRQ_GET_DESC_CHECK_PERCPU)
|
||||
return cpumask_test_cpu(smp_processor_id(), scoped_irqdesc->percpu_enabled);
|
||||
return false;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(irq_percpu_is_enabled);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue