aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/acpi
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-06-15 21:19:46 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-08 04:36:55 -0400
commit6df8809bbd1b48cc6d428df7372ed749c8711641 (patch)
tree6124bf3440d48cd474b79f8e7fcf378bee099a5e /arch/x86/kernel/acpi
parentd867e5310bd3c560093d39669ef52ff7f1b5711a (diff)
x86: use dstapic in mp_config_acpi_legacy_irqs
so we don't get the same value multiple times. also make mp_config_acpi_legacy_irqs more readable by moving assignments together. Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/acpi')
-rw-r--r--arch/x86/kernel/acpi/boot.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 4d370b1c5ae8..29b365a66cf3 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -962,8 +962,8 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base)
962 962
963void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi) 963void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi)
964{ 964{
965 int ioapic = -1; 965 int ioapic;
966 int pin = -1; 966 int pin;
967 967
968 /* 968 /*
969 * Convert 'gsi' to 'ioapic.pin'. 969 * Convert 'gsi' to 'ioapic.pin'.
@@ -997,8 +997,9 @@ void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi)
997 997
998void __init mp_config_acpi_legacy_irqs(void) 998void __init mp_config_acpi_legacy_irqs(void)
999{ 999{
1000 int i = 0; 1000 int i;
1001 int ioapic = -1; 1001 int ioapic;
1002 unsigned int dstapic;
1002 1003
1003#if defined (CONFIG_MCA) || defined (CONFIG_EISA) 1004#if defined (CONFIG_MCA) || defined (CONFIG_EISA)
1004 /* 1005 /*
@@ -1023,6 +1024,7 @@ void __init mp_config_acpi_legacy_irqs(void)
1023 ioapic = mp_find_ioapic(0); 1024 ioapic = mp_find_ioapic(0);
1024 if (ioapic < 0) 1025 if (ioapic < 0)
1025 return; 1026 return;
1027 dstapic = mp_ioapics[ioapic].mp_apicid;
1026 1028
1027 /* 1029 /*
1028 * Use the default configuration for the IRQs 0-15. Unless 1030 * Use the default configuration for the IRQs 0-15. Unless
@@ -1031,11 +1033,6 @@ void __init mp_config_acpi_legacy_irqs(void)
1031 for (i = 0; i < 16; i++) { 1033 for (i = 0; i < 16; i++) {
1032 int idx; 1034 int idx;
1033 1035
1034 mp_irqs[mp_irq_entries].mp_type = MP_INTSRC;
1035 mp_irqs[mp_irq_entries].mp_irqflag = 0; /* Conforming */
1036 mp_irqs[mp_irq_entries].mp_srcbus = MP_ISA_BUS;
1037 mp_irqs[mp_irq_entries].mp_dstapic = mp_ioapics[ioapic].mp_apicid;
1038
1039 for (idx = 0; idx < mp_irq_entries; idx++) { 1036 for (idx = 0; idx < mp_irq_entries; idx++) {
1040 struct mp_config_intsrc *irq = mp_irqs + idx; 1037 struct mp_config_intsrc *irq = mp_irqs + idx;
1041 1038
@@ -1045,9 +1042,8 @@ void __init mp_config_acpi_legacy_irqs(void)
1045 break; 1042 break;
1046 1043
1047 /* Do we already have a mapping for this IOAPIC pin */ 1044 /* Do we already have a mapping for this IOAPIC pin */
1048 if ((irq->mp_dstapic == 1045 if (irq->mp_dstapic == dstapic &&
1049 mp_irqs[mp_irq_entries].mp_dstapic) && 1046 irq->mp_dstirq == i)
1050 (irq->mp_dstirq == i))
1051 break; 1047 break;
1052 } 1048 }
1053 1049
@@ -1056,8 +1052,12 @@ void __init mp_config_acpi_legacy_irqs(void)
1056 continue; /* IRQ already used */ 1052 continue; /* IRQ already used */
1057 } 1053 }
1058 1054
1055 mp_irqs[mp_irq_entries].mp_type = MP_INTSRC;
1056 mp_irqs[mp_irq_entries].mp_irqflag = 0; /* Conforming */
1057 mp_irqs[mp_irq_entries].mp_srcbus = MP_ISA_BUS;
1058 mp_irqs[mp_irq_entries].mp_dstapic = dstapic;
1059 mp_irqs[mp_irq_entries].mp_irqtype = mp_INT; 1059 mp_irqs[mp_irq_entries].mp_irqtype = mp_INT;
1060 mp_irqs[mp_irq_entries].mp_srcbusirq = i; /* Identity mapped */ 1060 mp_irqs[mp_irq_entries].mp_srcbusirq = i; /* Identity mapped */
1061 mp_irqs[mp_irq_entries].mp_dstirq = i; 1061 mp_irqs[mp_irq_entries].mp_dstirq = i;
1062 1062
1063 if (++mp_irq_entries == MAX_IRQ_SOURCES) 1063 if (++mp_irq_entries == MAX_IRQ_SOURCES)