aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64
diff options
context:
space:
mode:
authorJiang Liu <jiang.liu@huawei.com>2013-09-01 23:57:35 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-09-23 19:39:39 -0400
commitd536bf3dc97417471e2c5098837a1cddd7fbb3c7 (patch)
tree215b3309564b76adb0b9dc92b51de9730bd73526 /arch/ia64
parentca9f62ac783bf88c54143f8065adc0fc8df859c1 (diff)
ACPI / processor: use apic_id and remove duplicated _MAT evaluation
Since APIC id is saved in processor struct, just use it and remove the duplicated _MAT evaluation. Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'arch/ia64')
-rw-r--r--arch/ia64/kernel/acpi.c38
1 files changed, 4 insertions, 34 deletions
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 5eb71d22c3d5..59d52e3aef12 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -882,40 +882,10 @@ __init void prefill_possible_map(void)
882 set_cpu_possible(i, true); 882 set_cpu_possible(i, true);
883} 883}
884 884
885static int _acpi_map_lsapic(acpi_handle handle, int *pcpu) 885static int _acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu)
886{ 886{
887 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
888 union acpi_object *obj;
889 struct acpi_madt_local_sapic *lsapic;
890 cpumask_t tmp_map; 887 cpumask_t tmp_map;
891 int cpu, physid; 888 int cpu;
892
893 if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer)))
894 return -EINVAL;
895
896 if (!buffer.length || !buffer.pointer)
897 return -EINVAL;
898
899 obj = buffer.pointer;
900 if (obj->type != ACPI_TYPE_BUFFER)
901 {
902 kfree(buffer.pointer);
903 return -EINVAL;
904 }
905
906 lsapic = (struct acpi_madt_local_sapic *)obj->buffer.pointer;
907
908 if ((lsapic->header.type != ACPI_MADT_TYPE_LOCAL_SAPIC) ||
909 (!(lsapic->lapic_flags & ACPI_MADT_ENABLED))) {
910 kfree(buffer.pointer);
911 return -EINVAL;
912 }
913
914 physid = ((lsapic->id << 8) | (lsapic->eid));
915
916 kfree(buffer.pointer);
917 buffer.length = ACPI_ALLOCATE_BUFFER;
918 buffer.pointer = NULL;
919 889
920 cpumask_complement(&tmp_map, cpu_present_mask); 890 cpumask_complement(&tmp_map, cpu_present_mask);
921 cpu = cpumask_first(&tmp_map); 891 cpu = cpumask_first(&tmp_map);
@@ -934,9 +904,9 @@ static int _acpi_map_lsapic(acpi_handle handle, int *pcpu)
934} 904}
935 905
936/* wrapper to silence section mismatch warning */ 906/* wrapper to silence section mismatch warning */
937int __ref acpi_map_lsapic(acpi_handle handle, int *pcpu) 907int __ref acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu)
938{ 908{
939 return _acpi_map_lsapic(handle, pcpu); 909 return _acpi_map_lsapic(handle, physid, pcpu);
940} 910}
941EXPORT_SYMBOL(acpi_map_lsapic); 911EXPORT_SYMBOL(acpi_map_lsapic);
942 912