[patch 20/26] genirq: Provide irq_is_allocated()

From: Thomas Gleixner
Date: Sun Feb 23 2014 - 16:44:59 EST


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@xxxxxxxxxxxxx>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/