Commit 772c53990fc29a34aec539abc6b2a1edbab8b2b5

Authored by Jiang Liu
Committed by Rafael J. Wysocki
1 parent 8b296d9412

ACPI / PAD / xen: use acpi_evaluate_ost() to replace open-coded version

Use public function acpi_evaluate_ost() to replace open-coded
version of evaluating ACPI _OST method.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Showing 1 changed file with 7 additions and 19 deletions Side-by-side Diff

drivers/xen/xen-acpi-pad.c
... ... @@ -77,28 +77,15 @@
77 77 return num;
78 78 }
79 79  
80   -/* Notify firmware how many CPUs are idle */
81   -static void acpi_pad_ost(acpi_handle handle, int stat,
82   - uint32_t idle_nums)
83   -{
84   - union acpi_object params[3] = {
85   - {.type = ACPI_TYPE_INTEGER,},
86   - {.type = ACPI_TYPE_INTEGER,},
87   - {.type = ACPI_TYPE_BUFFER,},
88   - };
89   - struct acpi_object_list arg_list = {3, params};
90   -
91   - params[0].integer.value = ACPI_PROCESSOR_AGGREGATOR_NOTIFY;
92   - params[1].integer.value = stat;
93   - params[2].buffer.length = 4;
94   - params[2].buffer.pointer = (void *)&idle_nums;
95   - acpi_evaluate_object(handle, "_OST", &arg_list, NULL);
96   -}
97   -
98 80 static void acpi_pad_handle_notify(acpi_handle handle)
99 81 {
100 82 int idle_nums;
  83 + struct acpi_buffer param = {
  84 + .length = 4,
  85 + .pointer = (void *)&idle_nums,
  86 + };
101 87  
  88 +
102 89 mutex_lock(&xen_cpu_lock);
103 90 idle_nums = acpi_pad_pur(handle);
104 91 if (idle_nums < 0) {
... ... @@ -109,7 +96,8 @@
109 96 idle_nums = xen_acpi_pad_idle_cpus(idle_nums)
110 97 ?: xen_acpi_pad_idle_cpus_num();
111 98 if (idle_nums >= 0)
112   - acpi_pad_ost(handle, 0, idle_nums);
  99 + acpi_evaluate_ost(handle, ACPI_PROCESSOR_AGGREGATOR_NOTIFY,
  100 + 0, &param);
113 101 mutex_unlock(&xen_cpu_lock);
114 102 }
115 103