[RFC Patch Part1 V1 11/30] x86, ioapic: replace get_nr_irqs_gsi() with arch_dynirq_lower_bound(0)

From: Jiang Liu
Date: Fri May 16 2014 - 04:19:57 EST


Currently all callers use get_nr_irqs_gsi() to get the lowest dynamic
allocatable IRQ number, and arch_dynirq_lower_bound(0) achieves the same
goal with a better name. So replace get_nr_irqs_gsi() with
arch_dynirq_lower_bound(0). It will also help to support dynamic IRQ
allocation for IOAPIC by using arch_dynirq_lower_bound().

Signed-off-by: Jiang Liu <jiang.liu@xxxxxxxxxxxxxxx>
---
arch/x86/include/asm/io_apic.h | 2 --
arch/x86/kernel/apic/io_apic.c | 5 -----
drivers/iommu/irq_remapping.c | 4 ++--
drivers/xen/events/events_base.c | 2 +-
4 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h
index 0c448ac14abf..de3d8b04cf64 100644
--- a/arch/x86/include/asm/io_apic.h
+++ b/arch/x86/include/asm/io_apic.h
@@ -160,8 +160,6 @@ extern int save_ioapic_entries(void);
extern void mask_ioapic_entries(void);
extern int restore_ioapic_entries(void);

-extern int get_nr_irqs_gsi(void);
-
extern void setup_ioapic_ids_from_mpc(void);
extern void setup_ioapic_ids_from_mpc_nocheck(void);

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index a338d9601841..2c91a7fc9915 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -3417,11 +3417,6 @@ static void __init probe_nr_irqs_gsi(void)
printk(KERN_DEBUG "nr_irqs_gsi: %d\n", nr_irqs_gsi);
}

-int get_nr_irqs_gsi(void)
-{
- return nr_irqs_gsi;
-}
-
unsigned int arch_dynirq_lower_bound(unsigned int from)
{
return from < nr_irqs_gsi ? nr_irqs_gsi : from;
diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c
index 228632c99adb..f874344409df 100644
--- a/drivers/iommu/irq_remapping.c
+++ b/drivers/iommu/irq_remapping.c
@@ -62,7 +62,7 @@ static int do_setup_msi_irqs(struct pci_dev *dev, int nvec)
WARN_ON(msidesc->nvec_used);

node = dev_to_node(&dev->dev);
- irq = __create_irqs(get_nr_irqs_gsi(), nvec, node);
+ irq = __create_irqs(arch_dynirq_lower_bound(0), nvec, node);
if (irq == 0)
return -ENOSPC;

@@ -109,7 +109,7 @@ static int do_setup_msix_irqs(struct pci_dev *dev, int nvec)
unsigned int irq;

node = dev_to_node(&dev->dev);
- irq = get_nr_irqs_gsi();
+ irq = arch_dynirq_lower_bound(0);
sub_handle = 0;

list_for_each_entry(msidesc, &dev->msi_list, list) {
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index dfa12a4a0a48..004e9bb293c6 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -402,7 +402,7 @@ static int __must_check xen_allocate_irqs_dynamic(int nvec)
* collisions.
*/
if (xen_initial_domain() || xen_hvm_domain())
- first = get_nr_irqs_gsi();
+ first = arch_dynirq_lower_bound(0);
#endif

irq = irq_alloc_descs_from(first, nvec, -1);
--
1.7.10.4

--
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/