diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2014-06-09 04:19:36 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-06-21 17:05:40 -0400 |
commit | e819813f5cb98030bab38569abffd9354a1c1a82 (patch) | |
tree | 5c94b38a14d9d38d461b26605483a1bd92e4a039 /arch | |
parent | 032329eebba86350849c027fe3a0b672558893d4 (diff) |
x86, ACPI, trivial: Minor improvements to arch/x86/kernel/acpi/boot.c
1) Remove out-of-date comment
2) Kill unused function acpi_set_irq_model_pic()
3) Use NR_IRQS_LEGACY instead of hard-coded 16
4) Trivial syntax improvements
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Len Brown <len.brown@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Jiri Kosina <trivial@kernel.org>
Link: http://lkml.kernel.org/r/1402302011-23642-8-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/acpi/boot.c | 50 |
1 files changed, 16 insertions, 34 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 09682766d56a..392360c607dc 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -483,11 +483,6 @@ static void __init acpi_sci_ioapic_setup(u8 bus_irq, u16 polarity, u16 trigger, | |||
483 | if (acpi_sci_flags & ACPI_MADT_POLARITY_MASK) | 483 | if (acpi_sci_flags & ACPI_MADT_POLARITY_MASK) |
484 | polarity = acpi_sci_flags & ACPI_MADT_POLARITY_MASK; | 484 | polarity = acpi_sci_flags & ACPI_MADT_POLARITY_MASK; |
485 | 485 | ||
486 | /* | ||
487 | * mp_config_acpi_legacy_irqs() already setup IRQs < 16 | ||
488 | * If GSI is < 16, this will update its flags, | ||
489 | * else it will create a new mp_irqs[] entry. | ||
490 | */ | ||
491 | mp_override_legacy_irq(bus_irq, polarity, trigger, gsi); | 486 | mp_override_legacy_irq(bus_irq, polarity, trigger, gsi); |
492 | 487 | ||
493 | /* | 488 | /* |
@@ -686,14 +681,7 @@ void acpi_unregister_gsi(u32 gsi) | |||
686 | } | 681 | } |
687 | EXPORT_SYMBOL_GPL(acpi_unregister_gsi); | 682 | EXPORT_SYMBOL_GPL(acpi_unregister_gsi); |
688 | 683 | ||
689 | void __init acpi_set_irq_model_pic(void) | 684 | static void __init acpi_set_irq_model_ioapic(void) |
690 | { | ||
691 | acpi_irq_model = ACPI_IRQ_MODEL_PIC; | ||
692 | __acpi_register_gsi = acpi_register_gsi_pic; | ||
693 | acpi_ioapic = 0; | ||
694 | } | ||
695 | |||
696 | void __init acpi_set_irq_model_ioapic(void) | ||
697 | { | 685 | { |
698 | acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC; | 686 | acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC; |
699 | __acpi_register_gsi = acpi_register_gsi_ioapic; | 687 | __acpi_register_gsi = acpi_register_gsi_ioapic; |
@@ -932,9 +920,8 @@ static int __init early_acpi_parse_madt_lapic_addr_ovr(void) | |||
932 | * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value). | 920 | * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value). |
933 | */ | 921 | */ |
934 | 922 | ||
935 | count = | 923 | count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE, |
936 | acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE, | 924 | acpi_parse_lapic_addr_ovr, 0); |
937 | acpi_parse_lapic_addr_ovr, 0); | ||
938 | if (count < 0) { | 925 | if (count < 0) { |
939 | printk(KERN_ERR PREFIX | 926 | printk(KERN_ERR PREFIX |
940 | "Error parsing LAPIC address override entry\n"); | 927 | "Error parsing LAPIC address override entry\n"); |
@@ -959,9 +946,8 @@ static int __init acpi_parse_madt_lapic_entries(void) | |||
959 | * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value). | 946 | * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value). |
960 | */ | 947 | */ |
961 | 948 | ||
962 | count = | 949 | count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE, |
963 | acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE, | 950 | acpi_parse_lapic_addr_ovr, 0); |
964 | acpi_parse_lapic_addr_ovr, 0); | ||
965 | if (count < 0) { | 951 | if (count < 0) { |
966 | printk(KERN_ERR PREFIX | 952 | printk(KERN_ERR PREFIX |
967 | "Error parsing LAPIC address override entry\n"); | 953 | "Error parsing LAPIC address override entry\n"); |
@@ -989,11 +975,10 @@ static int __init acpi_parse_madt_lapic_entries(void) | |||
989 | return count; | 975 | return count; |
990 | } | 976 | } |
991 | 977 | ||
992 | x2count = | 978 | x2count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_X2APIC_NMI, |
993 | acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_X2APIC_NMI, | 979 | acpi_parse_x2apic_nmi, 0); |
994 | acpi_parse_x2apic_nmi, 0); | 980 | count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_NMI, |
995 | count = | 981 | acpi_parse_lapic_nmi, 0); |
996 | acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_NMI, acpi_parse_lapic_nmi, 0); | ||
997 | if (count < 0 || x2count < 0) { | 982 | if (count < 0 || x2count < 0) { |
998 | printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); | 983 | printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); |
999 | /* TBD: Cleanup to allow fallback to MPS */ | 984 | /* TBD: Cleanup to allow fallback to MPS */ |
@@ -1022,7 +1007,7 @@ static void __init mp_config_acpi_legacy_irqs(void) | |||
1022 | * Use the default configuration for the IRQs 0-15. Unless | 1007 | * Use the default configuration for the IRQs 0-15. Unless |
1023 | * overridden by (MADT) interrupt source override entries. | 1008 | * overridden by (MADT) interrupt source override entries. |
1024 | */ | 1009 | */ |
1025 | for (i = 0; i < 16; i++) { | 1010 | for (i = 0; i < NR_IRQS_LEGACY; i++) { |
1026 | int ioapic, pin; | 1011 | int ioapic, pin; |
1027 | unsigned int dstapic; | 1012 | unsigned int dstapic; |
1028 | int idx; | 1013 | int idx; |
@@ -1099,9 +1084,8 @@ static int __init acpi_parse_madt_ioapic_entries(void) | |||
1099 | return -ENODEV; | 1084 | return -ENODEV; |
1100 | } | 1085 | } |
1101 | 1086 | ||
1102 | count = | 1087 | count = acpi_table_parse_madt(ACPI_MADT_TYPE_IO_APIC, acpi_parse_ioapic, |
1103 | acpi_table_parse_madt(ACPI_MADT_TYPE_IO_APIC, acpi_parse_ioapic, | 1088 | MAX_IO_APICS); |
1104 | MAX_IO_APICS); | ||
1105 | if (!count) { | 1089 | if (!count) { |
1106 | printk(KERN_ERR PREFIX "No IOAPIC entries present\n"); | 1090 | printk(KERN_ERR PREFIX "No IOAPIC entries present\n"); |
1107 | return -ENODEV; | 1091 | return -ENODEV; |
@@ -1110,9 +1094,8 @@ static int __init acpi_parse_madt_ioapic_entries(void) | |||
1110 | return count; | 1094 | return count; |
1111 | } | 1095 | } |
1112 | 1096 | ||
1113 | count = | 1097 | count = acpi_table_parse_madt(ACPI_MADT_TYPE_INTERRUPT_OVERRIDE, |
1114 | acpi_table_parse_madt(ACPI_MADT_TYPE_INTERRUPT_OVERRIDE, acpi_parse_int_src_ovr, | 1098 | acpi_parse_int_src_ovr, nr_irqs); |
1115 | nr_irqs); | ||
1116 | if (count < 0) { | 1099 | if (count < 0) { |
1117 | printk(KERN_ERR PREFIX | 1100 | printk(KERN_ERR PREFIX |
1118 | "Error parsing interrupt source overrides entry\n"); | 1101 | "Error parsing interrupt source overrides entry\n"); |
@@ -1131,9 +1114,8 @@ static int __init acpi_parse_madt_ioapic_entries(void) | |||
1131 | /* Fill in identity legacy mappings where no override */ | 1114 | /* Fill in identity legacy mappings where no override */ |
1132 | mp_config_acpi_legacy_irqs(); | 1115 | mp_config_acpi_legacy_irqs(); |
1133 | 1116 | ||
1134 | count = | 1117 | count = acpi_table_parse_madt(ACPI_MADT_TYPE_NMI_SOURCE, |
1135 | acpi_table_parse_madt(ACPI_MADT_TYPE_NMI_SOURCE, acpi_parse_nmi_src, | 1118 | acpi_parse_nmi_src, nr_irqs); |
1136 | nr_irqs); | ||
1137 | if (count < 0) { | 1119 | if (count < 0) { |
1138 | printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n"); | 1120 | printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n"); |
1139 | /* TBD: Cleanup to allow fallback to MPS */ | 1121 | /* TBD: Cleanup to allow fallback to MPS */ |