[PATCH 06/30] ACPI-processor: Move a success indication in acpi_processor_preregister_performance()

From: SF Markus Elfring
Date: Sat Sep 10 2016 - 05:44:16 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 6 Sep 2016 13:03:56 +0200

The local variable "retval" was initialised with a zero at the beginning
as an indication for a successful function execution despite of
the possibility that following function calls could fail.
Move the desired assignment down to the source code place where some system
clean-up is performed.

Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
drivers/acpi/processor_perflib.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 2fc82e7..417e181 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -595,7 +595,7 @@ int acpi_processor_preregister_performance(
struct acpi_processor_performance __percpu *performance)
{
int count_target;
- int retval = 0;
+ int retval;
unsigned int i, j;
cpumask_var_t covered_cpus;
struct acpi_processor *pr;
@@ -719,6 +719,8 @@ int acpi_processor_preregister_performance(
pr->performance->shared_cpu_map);
}
}
+
+ retval = 0;
clear_cpu:
for_each_possible_cpu(i) {
pr = per_cpu(processors, i);
--
2.10.0