Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1480586
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 26/30] ACPI-processor: Fix jump targets in acpi_processor_reevaluate_tstate() |
| Date | 2016-09-10 12:10 +0200 |
| Message-ID | <sfNot-7ju-13@gated-at.bofh.it> (permalink) |
| References | <sfMVr-6Un-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Markus Elfring <elfring@users.sourceforge.net>
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@users.sourceforge.net>
---
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/30] ACPI-processor: Fine-tuning for several function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 11:40 +0200 [PATCH 03/30] ACPI-processor: Rename jump labels in acpi_processor_get_performance_states() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 11:50 +0200 [PATCH 05/30] ACPI-processor: Rename jump labels in acpi_processor_preregister_performance() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 11:50 +0200 [PATCH 04/30] ACPI-processor: Delete two unnecessary initialisations in acpi_processor_get_performance_states() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 11:50 +0200 [PATCH 08/30] ACPI-processor: Delete two unnecessary initialisations in acpi_processor_get_psd() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 11:50 +0200 [PATCH 07/30] ACPI-processor: Rename jump labels in acpi_processor_get_psd() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 11:50 +0200 [PATCH 06/30] ACPI-processor: Move a success indication in acpi_processor_preregister_performance() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 11:50 +0200 [PATCH 15/30] ACPI-processor: Delete an unnecessary initialisation in acpi_processor_get_platform_limit() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:00 +0200 [PATCH 17/30] ACPI-processor: Improve another size determination in acpi_processor_get_throttling_states() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:00 +0200 [PATCH 10/30] ACPI-processor: Rename jump labels in acpi_processor_get_performance_control() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:00 +0200 [PATCH 16/30] ACPI-processor: Use kmalloc_array() in acpi_processor_get_throttling_states() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:00 +0200 [PATCH 11/30] ACPI-processor: Delete two unnecessary initialisations in acpi_processor_get_performance_control() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:00 +0200 [PATCH 09/30] ACPI-processor: Improve a size determination in acpi_processor_get_psd() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:00 +0200 [PATCH 14/30] ACPI-processor: Delete an unnecessary initialisation in acpi_processor_get_performance_info() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:00 +0200 Re: [PATCH 00/30] ACPI-processor: Fine-tuning for several function implementations Paolo Bonzini <pbonzini@redhat.com> - 2016-09-10 12:00 +0200 [PATCH 13/30] ACPI-processor: Delete an unnecessary initialisation in acpi_processor_ppc_notifier() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:00 +0200 [PATCH 12/30] ACPI-processor: Rename jump labels in acpi_processor_ppc_notifier() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:00 +0200 [PATCH 23/30] ACPI-processor: Improve a size determination in acpi_processor_get_tsd() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:10 +0200 [PATCH 25/30] ACPI-processor: Delete two unnecessary initialisations in acpi_processor_get_throttling_control() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:10 +0200 [PATCH 27/30] ACPI-processor: Delete an unnecessary initialisation in acpi_processor_reevaluate_tstate() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:10 +0200 [PATCH 26/30] ACPI-processor: Fix jump targets in acpi_processor_reevaluate_tstate() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:10 +0200 [PATCH 19/30] ACPI-processor: Delete two unnecessary initialisations in acpi_processor_get_throttling_states() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:10 +0200 [PATCH 18/30] ACPI-processor: Rename jump labels in acpi_processor_get_throttling_states() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:10 +0200 [PATCH 21/30] ACPI-processor: Rename jump labels in acpi_processor_get_tsd() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:10 +0200 [PATCH 22/30] ACPI-processor: Delete two unnecessary initialisations in acpi_processor_get_tsd() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:10 +0200 [PATCH 24/30] ACPI-processor: Rename jump labels in acpi_processor_get_throttling_control() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:10 +0200 [PATCH 20/30] ACPI-processor: Fix jump targets in acpi_processor_get_throttling_info() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:10 +0200 [PATCH 29/30] ACPI-processor: Delete an unnecessary initialisation in acpi_processor_get_platform_limit() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:20 +0200 [PATCH 28/30] ACPI-processor: Rename a jump label in acpi_processor_get_platform_limit() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:20 +0200 [PATCH 30/30] ACPI-processor: Improve jump targets in acpi_processor_update_tsd_coord() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:20 +0200
csiph-web