Commit-ID: a8ef54aeb4308d3730ff31807c495390b98de16a Gitweb: http://git.kernel.org/tip/a8ef54aeb4308d3730ff31807c495390b98de16a Author: Thomas Gleixner <tglx@xxxxxxxxxxxxx> AuthorDate: Mon, 4 Oct 2010 16:51:27 +0200 Committer: Thomas Gleixner <tglx@xxxxxxxxxxxxx> CommitDate: Tue, 12 Oct 2010 16:53:41 +0200 pci: intr_remap: Use irq_data No need to dereference irq_desc. Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Reviewed-by: Ingo Molnar <mingo@xxxxxxx> Acked-by: Suresh Siddha <suresh.b.siddha@xxxxxxxxx> Cc: David Woodhouse <dwmw2@xxxxxxxxxxxxx> Cc: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx> --- drivers/pci/intr_remapping.c | 39 ++++++++------------------------------- 1 files changed, 8 insertions(+), 31 deletions(-) diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c index 87ec390..cb62529 100644 --- a/drivers/pci/intr_remapping.c +++ b/drivers/pci/intr_remapping.c @@ -54,45 +54,22 @@ struct irq_2_iommu { }; #ifdef CONFIG_GENERIC_HARDIRQS -static struct irq_2_iommu *get_one_free_irq_2_iommu(int node) -{ - struct irq_2_iommu *iommu; - - iommu = kzalloc_node(sizeof(*iommu), GFP_ATOMIC, node); - printk(KERN_DEBUG "alloc irq_2_iommu on node %d\n", node); - - return iommu; -} - static struct irq_2_iommu *irq_2_iommu(unsigned int irq) { - struct irq_desc *desc; - - desc = irq_to_desc(irq); - - if (WARN_ON_ONCE(!desc)) - return NULL; - - return desc->irq_2_iommu; + return get_irq_iommu(irq); } static struct irq_2_iommu *irq_2_iommu_alloc(unsigned int irq) { - struct irq_desc *desc; - struct irq_2_iommu *irq_iommu; + struct irq_data *data = irq_get_irq_data(irq); - desc = irq_to_desc(irq); - if (!desc) { - printk(KERN_INFO "can not get irq_desc for %d\n", irq); - return NULL; - } - - irq_iommu = desc->irq_2_iommu; - - if (!irq_iommu) - desc->irq_2_iommu = get_one_free_irq_2_iommu(irq_node(irq)); + if (WARN_ONCE(data->irq_2_iommu, + KERN_DEBUG "irq_2_iommu!=NULL irq %u\n", irq)) + return data->irq_2_iommu; - return desc->irq_2_iommu; + data->irq_2_iommu = kzalloc_node(sizeof(*data->irq_2_iommu), + GFP_ATOMIC, data->node); + return data->irq_2_iommu; } static void irq_2_iommu_free(unsigned int irq) -- To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html