lkml.org 
[lkml]   [2016]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 20/30] ACPI-processor: Fix jump targets in acpi_processor_get_throttling_info()
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 6 Sep 2016 20:32:46 +0200

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

2. Delete a duplicate check then at the end.

3. Omit the explicit initialisation for the local variable "result"
at the beginning which became unnecessary with this refactoring.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/acpi/processor_throttling.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index 8847bca..24bd97f 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -1184,7 +1184,7 @@ int acpi_processor_set_throttling(struct acpi_processor *pr,

int acpi_processor_get_throttling_info(struct acpi_processor *pr)
{
- int result = 0;
+ int result;
struct acpi_processor_throttling *pthrottling;

ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@ -1249,7 +1249,7 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)

result = acpi_processor_get_throttling(pr);
if (result)
- goto end;
+ goto disable_throttling;

if (pr->throttling.state) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@ -1257,13 +1257,11 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
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 0;
+ disable_throttling:
+ pr->flags.throttling = 0;
return result;
}

--
2.10.0
\
 
 \ /
  Last update: 2016-09-17 09:59    [W:0.095 / U:0.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site