[PATCH 26/30] ACPI-processor: Fix jump targets in acpi_processor_reevaluate_tstate()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 6 Sep 2016 21:40:40 +0200

1. Adjust jump targets according to the current Linux coding
   style convention.

2. Delete a duplicate check then at the end.

3. Do not use curly brackets at two source code places
   where a single statement should be sufficient.

Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
 drivers/acpi/processor_throttling.c | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index 0b4e058..994f21c 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -379,23 +379,19 @@ void acpi_processor_reevaluate_tstate(struct acpi_processor *pr,
 {
 	int result = 0;
 
-	if (action == CPU_DEAD) {
+	if (action == CPU_DEAD)
 		/* When one CPU is offline, the T-state throttling
 		 * will be invalidated.
 		 */
-		pr->flags.throttling = 0;
-		return;
-	}
+		goto disable_throttling;
 	/* the following is to recheck whether the T-state is valid for
 	 * the online CPU
 	 */
-	if (!pr->throttling.state_count) {
+	if (!pr->throttling.state_count)
 		/* If the number of T-state is invalid, it is
 		 * invalidated.
 		 */
-		pr->flags.throttling = 0;
-		return;
-	}
+		goto disable_throttling;
 	pr->flags.throttling = 1;
 
 	/* Disable throttling (if enabled).  We'll let subsequent
@@ -405,17 +401,16 @@ void acpi_processor_reevaluate_tstate(struct acpi_processor *pr,
 
 	result = acpi_processor_get_throttling(pr);
 	if (result)
-		goto end;
+		goto disable_throttling;
 
 	if (pr->throttling.state) {
 		result = acpi_processor_set_throttling(pr, 0, false);
 		if (result)
-			goto end;
+			goto disable_throttling;
 	}
-
-end:
-	if (result)
-		pr->flags.throttling = 0;
+	return;
+ disable_throttling:
+	pr->flags.throttling = 0;
 }
 /*
  * _PTC - Processor Throttling Control (and status) register location
-- 
2.10.0

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux