Skip to content

Commit f642974

Browse files
bvanasscheKAGA-KOKO
authored andcommitted
x86/acpi: Switch to irq_get_nr_irqs() and irq_set_nr_irqs()
Use the irq_get_nr_irqs() and irq_set_nr_irqs() functions instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 9512483 commit f642974

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

arch/x86/kernel/acpi/boot.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,8 @@ static int __init acpi_parse_madt_ioapic_entries(void)
11711171
}
11721172

11731173
count = acpi_table_parse_madt(ACPI_MADT_TYPE_INTERRUPT_OVERRIDE,
1174-
acpi_parse_int_src_ovr, nr_irqs);
1174+
acpi_parse_int_src_ovr,
1175+
irq_get_nr_irqs());
11751176
if (count < 0) {
11761177
pr_err("Error parsing interrupt source overrides entry\n");
11771178
/* TBD: Cleanup to allow fallback to MPS */
@@ -1191,7 +1192,8 @@ static int __init acpi_parse_madt_ioapic_entries(void)
11911192
mp_config_acpi_legacy_irqs();
11921193

11931194
count = acpi_table_parse_madt(ACPI_MADT_TYPE_NMI_SOURCE,
1194-
acpi_parse_nmi_src, nr_irqs);
1195+
acpi_parse_nmi_src,
1196+
irq_get_nr_irqs());
11951197
if (count < 0) {
11961198
pr_err("Error parsing NMI SRC entry\n");
11971199
/* TBD: Cleanup to allow fallback to MPS */

arch/x86/kernel/apic/vector.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -712,8 +712,8 @@ int __init arch_probe_nr_irqs(void)
712712
{
713713
int nr;
714714

715-
if (nr_irqs > (NR_VECTORS * nr_cpu_ids))
716-
nr_irqs = NR_VECTORS * nr_cpu_ids;
715+
if (irq_get_nr_irqs() > NR_VECTORS * nr_cpu_ids)
716+
irq_set_nr_irqs(NR_VECTORS * nr_cpu_ids);
717717

718718
nr = (gsi_top + nr_legacy_irqs()) + 8 * nr_cpu_ids;
719719
#if defined(CONFIG_PCI_MSI)
@@ -725,8 +725,8 @@ int __init arch_probe_nr_irqs(void)
725725
else
726726
nr += gsi_top * 16;
727727
#endif
728-
if (nr < nr_irqs)
729-
nr_irqs = nr;
728+
if (nr < irq_get_nr_irqs())
729+
irq_set_nr_irqs(nr);
730730

731731
/*
732732
* We don't know if PIC is present at this point so we need to do

0 commit comments

Comments
 (0)