Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[platform/adaptation/renesas_rcar/renesas_kernel.git] / arch / x86 / kernel / acpi / boot.c
index c7f61cf..8e594a4 100644 (file)
@@ -192,7 +192,7 @@ static void acpi_register_lapic(int id, u8 enabled)
 {
        unsigned int ver = 0;
 
-       if (id >= (MAX_LOCAL_APIC-1)) {
+       if (id >= MAX_LOCAL_APIC) {
                printk(KERN_INFO PREFIX "skipped apicid that is too big\n");
                return;
        }
@@ -1113,6 +1113,7 @@ int mp_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity)
        int ioapic;
        int ioapic_pin;
        struct io_apic_irq_attr irq_attr;
+       int ret;
 
        if (acpi_irq_model != ACPI_IRQ_MODEL_IOAPIC)
                return gsi;
@@ -1142,7 +1143,9 @@ int mp_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity)
        set_io_apic_irq_attr(&irq_attr, ioapic, ioapic_pin,
                             trigger == ACPI_EDGE_SENSITIVE ? 0 : 1,
                             polarity == ACPI_ACTIVE_HIGH ? 0 : 1);
-       io_apic_set_pci_routing(dev, gsi_to_irq(gsi), &irq_attr);
+       ret = io_apic_set_pci_routing(dev, gsi_to_irq(gsi), &irq_attr);
+       if (ret < 0)
+               gsi = INT_MIN;
 
        return gsi;
 }