diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2022-12-05 20:05:55 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2022-12-07 18:09:39 +0100 |
commit | 5be583c695ed4d94211cc28282a42092b137f988 (patch) | |
tree | 45e734a7fc9bf773e9b2a5a3ab6486dbd8821346 /drivers/acpi/processor_perflib.c | |
parent | d8f4ed072817cce79aef90926a4187954e1548fd (diff) | |
download | lwn-5be583c695ed4d94211cc28282a42092b137f988.tar.gz lwn-5be583c695ed4d94211cc28282a42092b137f988.zip |
ACPI: processor: perflib: Rearrange unregistration routine
Rearrange acpi_processor_unregister_performance() to follow a more
common error handling pattern and drop a redundant "return" statement
from the end of it.
No expected functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/processor_perflib.c')
-rw-r--r-- | drivers/acpi/processor_perflib.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index 388f045580ff..10d2999a5773 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c @@ -754,18 +754,15 @@ void acpi_processor_unregister_performance(unsigned int cpu) mutex_lock(&performance_mutex); pr = per_cpu(processors, cpu); - if (!pr) { - mutex_unlock(&performance_mutex); - return; - } + if (!pr) + goto unlock; if (pr->performance) kfree(pr->performance->states); pr->performance = NULL; +unlock: mutex_unlock(&performance_mutex); - - return; } EXPORT_SYMBOL(acpi_processor_unregister_performance); |