Skip to content

Commit 3d9e9a9

Browse files
committed
ACPI: processor: perflib: Adjust white space
Some inconsistent usage of white space in the ACPI processor performance library code causes that code to be somewhat harder to read that it would have been otherwise, so adjust the white space in there to address that. No expected functional impact. Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent b697b81 commit 3d9e9a9

File tree

1 file changed

+15
-20
lines changed

1 file changed

+15
-20
lines changed

drivers/acpi/processor_perflib.c

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ int acpi_processor_get_bios_limit(int cpu, unsigned int *limit)
142142
pr = per_cpu(processors, cpu);
143143
if (!pr || !pr->performance || !pr->performance->state_count)
144144
return -ENODEV;
145+
145146
*limit = pr->performance->states[pr->performance_platform_limit].
146147
core_frequency * 1000;
147148
return 0;
@@ -201,8 +202,7 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
201202
}
202203

203204
pct = (union acpi_object *)buffer.pointer;
204-
if (!pct || (pct->type != ACPI_TYPE_PACKAGE)
205-
|| (pct->package.count != 2)) {
205+
if (!pct || (pct->type != ACPI_TYPE_PACKAGE) || (pct->package.count != 2)) {
206206
pr_err("Invalid _PCT data\n");
207207
result = -EFAULT;
208208
goto end;
@@ -214,9 +214,9 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
214214

215215
obj = pct->package.elements[0];
216216

217-
if ((obj.type != ACPI_TYPE_BUFFER)
218-
|| (obj.buffer.length < sizeof(struct acpi_pct_register))
219-
|| (obj.buffer.pointer == NULL)) {
217+
if ((obj.type != ACPI_TYPE_BUFFER) ||
218+
(obj.buffer.length < sizeof(struct acpi_pct_register)) ||
219+
(obj.buffer.pointer == NULL)) {
220220
pr_err("Invalid _PCT data (control_register)\n");
221221
result = -EFAULT;
222222
goto end;
@@ -230,9 +230,9 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
230230

231231
obj = pct->package.elements[1];
232232

233-
if ((obj.type != ACPI_TYPE_BUFFER)
234-
|| (obj.buffer.length < sizeof(struct acpi_pct_register))
235-
|| (obj.buffer.pointer == NULL)) {
233+
if ((obj.type != ACPI_TYPE_BUFFER) ||
234+
(obj.buffer.length < sizeof(struct acpi_pct_register)) ||
235+
(obj.buffer.pointer == NULL)) {
236236
pr_err("Invalid _PCT data (status_register)\n");
237237
result = -EFAULT;
238238
goto end;
@@ -260,8 +260,8 @@ static void amd_fixup_frequency(struct acpi_processor_px *px, int i)
260260
if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
261261
return;
262262

263-
if ((boot_cpu_data.x86 == 0x10 && boot_cpu_data.x86_model < 10)
264-
|| boot_cpu_data.x86 == 0x11) {
263+
if ((boot_cpu_data.x86 == 0x10 && boot_cpu_data.x86_model < 10) ||
264+
boot_cpu_data.x86 == 0x11) {
265265
rdmsr(MSR_AMD_PSTATE_DEF_BASE + index, lo, hi);
266266
/*
267267
* MSR C001_0064+:
@@ -353,8 +353,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
353353
* Check that ACPI's u64 MHz will be valid as u32 KHz in cpufreq
354354
*/
355355
if (!px->core_frequency ||
356-
((u32)(px->core_frequency * 1000) !=
357-
(px->core_frequency * 1000))) {
356+
((u32)(px->core_frequency * 1000) != (px->core_frequency * 1000))) {
358357
pr_err(FW_BUG
359358
"Invalid BIOS _PSS frequency found for processor %d: 0x%llx MHz\n",
360359
pr->id, px->core_frequency);
@@ -499,7 +498,6 @@ int acpi_processor_notify_smm(struct module *calling_module)
499498

500499
return 0;
501500
}
502-
503501
EXPORT_SYMBOL(acpi_processor_notify_smm);
504502

505503
int acpi_processor_get_psd(acpi_handle handle, struct acpi_psd_package *pdomain)
@@ -532,8 +530,7 @@ int acpi_processor_get_psd(acpi_handle handle, struct acpi_psd_package *pdomain)
532530
state.length = sizeof(struct acpi_psd_package);
533531
state.pointer = pdomain;
534532

535-
status = acpi_extract_package(&(psd->package.elements[0]),
536-
&format, &state);
533+
status = acpi_extract_package(&(psd->package.elements[0]), &format, &state);
537534
if (ACPI_FAILURE(status)) {
538535
pr_err("Invalid _PSD data\n");
539536
result = -EFAULT;
@@ -716,9 +713,8 @@ int acpi_processor_preregister_performance(
716713
}
717714
EXPORT_SYMBOL(acpi_processor_preregister_performance);
718715

719-
int
720-
acpi_processor_register_performance(struct acpi_processor_performance
721-
*performance, unsigned int cpu)
716+
int acpi_processor_register_performance(struct acpi_processor_performance
717+
*performance, unsigned int cpu)
722718
{
723719
struct acpi_processor *pr;
724720

@@ -751,7 +747,6 @@ acpi_processor_register_performance(struct acpi_processor_performance
751747
mutex_unlock(&performance_mutex);
752748
return 0;
753749
}
754-
755750
EXPORT_SYMBOL(acpi_processor_register_performance);
756751

757752
void acpi_processor_unregister_performance(unsigned int cpu)
@@ -768,11 +763,11 @@ void acpi_processor_unregister_performance(unsigned int cpu)
768763

769764
if (pr->performance)
770765
kfree(pr->performance->states);
766+
771767
pr->performance = NULL;
772768

773769
mutex_unlock(&performance_mutex);
774770

775771
return;
776772
}
777-
778773
EXPORT_SYMBOL(acpi_processor_unregister_performance);

0 commit comments

Comments
 (0)