| Date | Sun, 23 Feb 2014 21:40:19 -0000 | From | Thomas Gleixner <> | Subject | [patch 20/26] genirq: Provide irq_is_allocated() |
| |
Another proper interface to replace Xen hackery. No idea why Xen needs this, but I'm not masochistic enough to understand that mess.
Not-Yet-Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> --- kernel/irq/irqdesc.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
Index: tip/kernel/irq/irqdesc.c =================================================================== --- tip.orig/kernel/irq/irqdesc.c +++ tip/kernel/irq/irqdesc.c @@ -390,6 +390,17 @@ err: EXPORT_SYMBOL_GPL(__irq_alloc_descs); /** + * irq_is_allocated - query whether an irq desc is allocated for an irq number + * @irq: irq number + * + * Returns a momentary racy snapshot of the allocation state + */ +bool irq_is_allocated(unsigned int irq) +{ + return irq < nr_irqs && test_bit(irq, allocated_irqs); +} + +/** * irq_reserve_irqs - mark irqs allocated * @from: mark from irq number * @cnt: number of irqs to mark
|