aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2017-12-15 16:25:09 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-12-28 06:36:46 -0500
commit220580fb0d0a71cff0f17c24463c787f43dd6626 (patch)
tree8cd740efb8156a048c8e1cf5299fbd455bd49d30
parent7d7fb91cb43aebdcadca6a0fce25c3174feab980 (diff)
ACPI / x86: boot: Get rid of ACPI_INVALID_GSI
Commit 49e4b84333f3 (ACPI: Use correct IRQ when uninstalling ACPI interrupt handler) brings a new definition for invalid ACPI IRQ, i.e. INVALID_ACPI_IRQ, which is defined to 0xffffffff (or -1 for unsigned value). Get rid of a former one, which was brought in by commit 2c0a6894df19 (x86, ACPI, irq: Enhance error handling in function acpi_register_gsi()), in favour of latter. To clarify the rationale of changing from INT_MIN to ((unsigned)-1) definition consider the following: - IRQ 0 is valid one in hardware, so, better not to use it everywhere (Linux uses 0 as NO IRQ, though it's another story) - INT_MIN splits the range into two, while 0xffffffff reserves only the last item - when type casting is done in most cases 0xff, 0xffff is naturally used as a marker of invalid HW IRQ: for example PCI INT line 0xff means no IRQ assigned by BIOS Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--arch/x86/kernel/acpi/boot.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 4bad714d6227..56752b48e480 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -112,8 +112,6 @@ static u32 isa_irq_to_gsi[NR_IRQS_LEGACY] __read_mostly = {
112 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 112 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
113}; 113};
114 114
115#define ACPI_INVALID_GSI INT_MIN
116
117/* 115/*
118 * This is just a simple wrapper around early_memremap(), 116 * This is just a simple wrapper around early_memremap(),
119 * with sanity checks for phys == 0 and size == 0. 117 * with sanity checks for phys == 0 and size == 0.
@@ -372,7 +370,7 @@ static void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger,
372 * and acpi_isa_irq_to_gsi() may give wrong result. 370 * and acpi_isa_irq_to_gsi() may give wrong result.
373 */ 371 */
374 if (gsi < nr_legacy_irqs() && isa_irq_to_gsi[gsi] == gsi) 372 if (gsi < nr_legacy_irqs() && isa_irq_to_gsi[gsi] == gsi)
375 isa_irq_to_gsi[gsi] = ACPI_INVALID_GSI; 373 isa_irq_to_gsi[gsi] = INVALID_ACPI_IRQ;
376 isa_irq_to_gsi[bus_irq] = gsi; 374 isa_irq_to_gsi[bus_irq] = gsi;
377} 375}
378 376
@@ -637,7 +635,7 @@ EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
637int acpi_isa_irq_to_gsi(unsigned isa_irq, u32 *gsi) 635int acpi_isa_irq_to_gsi(unsigned isa_irq, u32 *gsi)
638{ 636{
639 if (isa_irq < nr_legacy_irqs() && 637 if (isa_irq < nr_legacy_irqs() &&
640 isa_irq_to_gsi[isa_irq] != ACPI_INVALID_GSI) { 638 isa_irq_to_gsi[isa_irq] != INVALID_ACPI_IRQ) {
641 *gsi = isa_irq_to_gsi[isa_irq]; 639 *gsi = isa_irq_to_gsi[isa_irq];
642 return 0; 640 return 0;
643 } 641 }