Skip to content

Commit 43bab25

Browse files
Alex Chianglenb
authored andcommitted
ACPI: processor: change acpi_processor_set_pdc() interface
When calling _PDC, we really only need the handle to the processor to call the method; we don't look at any other parts of the struct acpi_processor * given to us. In the early path, when we walk the namespace, we are given the handle directly, so just pass it through to acpi_processor_set_pdc() without stuffing it into a wasteful struct acpi_processor allocated on the stack each time This saves 2834 bytes of stack. Update the interface accordingly. Signed-off-by: Alex Chiang <achiang@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
1 parent b9c2db7 commit 43bab25

3 files changed

Lines changed: 5 additions & 17 deletions

File tree

‎drivers/acpi/processor_core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
763763
}
764764

765765
/* _PDC call should be done before doing anything else (if reqd.). */
766-
acpi_processor_set_pdc(pr);
766+
acpi_processor_set_pdc(pr->handle);
767767

768768
#ifdef CONFIG_CPU_FREQ
769769
acpi_processor_ppc_has_changed(pr, 0);

‎drivers/acpi/processor_pdc.c‎

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in)
125125
return status;
126126
}
127127

128-
void acpi_processor_set_pdc(struct acpi_processor *pr)
128+
void acpi_processor_set_pdc(acpi_handle handle)
129129
{
130130
struct acpi_object_list *obj_list;
131131

@@ -136,7 +136,7 @@ void acpi_processor_set_pdc(struct acpi_processor *pr)
136136
if (!obj_list)
137137
return;
138138

139-
acpi_processor_eval_pdc(pr->handle, obj_list);
139+
acpi_processor_eval_pdc(handle, obj_list);
140140

141141
kfree(obj_list->pointer->buffer.pointer);
142142
kfree(obj_list->pointer);
@@ -147,19 +147,7 @@ EXPORT_SYMBOL_GPL(acpi_processor_set_pdc);
147147
static acpi_status
148148
early_init_pdc(acpi_handle handle, u32 lvl, void *context, void **rv)
149149
{
150-
struct acpi_processor pr;
151-
152-
pr.handle = handle;
153-
154-
/* x86 implementation looks at pr.id to determine some
155-
* CPU capabilites. We can just hard code to 0 since we're
156-
* assuming the CPUs in the system are homogenous and all
157-
* have the same capabilities.
158-
*/
159-
pr.id = 0;
160-
161-
acpi_processor_set_pdc(&pr);
162-
150+
acpi_processor_set_pdc(handle);
163151
return AE_OK;
164152
}
165153

‎include/acpi/processor.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ static inline int acpi_processor_get_bios_limit(int cpu, unsigned int *limit)
323323
#endif /* CONFIG_CPU_FREQ */
324324

325325
/* in processor_pdc.c */
326-
void acpi_processor_set_pdc(struct acpi_processor *pr);
326+
void acpi_processor_set_pdc(acpi_handle handle);
327327

328328
/* in processor_throttling.c */
329329
int acpi_processor_tstate_has_changed(struct acpi_processor *pr);

0 commit comments

Comments
 (0)