Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1343561 > unrolled thread
| Started by | "Rafael J. Wysocki" <rjw@rjwysocki.net> |
|---|---|
| First post | 2016-02-26 00:10 +0100 |
| Last post | 2016-02-26 03:40 +0100 |
| Articles | 5 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH 0/2] cpufreq cleanups related to pointless labels "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-02-26 00:10 +0100
[PATCH 2/2] cpufreq: acpi-cpufreq: Drop pointless label from acpi_cpufreq_target() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-02-26 00:10 +0100
Re: [PATCH 2/2] cpufreq: acpi-cpufreq: Drop pointless label from acpi_cpufreq_target() Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> - 2016-02-26 00:50 +0100
[PATCH 1/2] cpufreq: Rearrange __cpufreq_driver_target() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-02-26 00:10 +0100
Re: [PATCH 0/2] cpufreq cleanups related to pointless labels Viresh Kumar <viresh.kumar@linaro.org> - 2016-02-26 03:40 +0100
| From | "Rafael J. Wysocki" <rjw@rjwysocki.net> |
|---|---|
| Date | 2016-02-26 00:10 +0100 |
| Subject | [PATCH 0/2] cpufreq cleanups related to pointless labels |
| Message-ID | <r6dcJ-2Ch-1@gated-at.bofh.it> |
Hi, Two cleanups removing pointless labels at return statements from the core and the ACPI driver. On opt of the current linux-next branch of linux-pm.git. Thanks, Rafael
[toc] | [next] | [standalone]
| From | "Rafael J. Wysocki" <rjw@rjwysocki.net> |
|---|---|
| Date | 2016-02-26 00:10 +0100 |
| Subject | [PATCH 2/2] cpufreq: acpi-cpufreq: Drop pointless label from acpi_cpufreq_target() |
| Message-ID | <r6dcJ-2Ch-3@gated-at.bofh.it> |
| In reply to | #1343561 |
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
The "out" label at the final return statement in acpi_cpufreq_target()
is totally pointless, so drop them and modify the code to return the
right values immediately instead of jumping to it.
No functional changes.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/cpufreq/acpi-cpufreq.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
Index: linux-pm/drivers/cpufreq/acpi-cpufreq.c
===================================================================
--- linux-pm.orig/drivers/cpufreq/acpi-cpufreq.c
+++ linux-pm/drivers/cpufreq/acpi-cpufreq.c
@@ -434,7 +434,7 @@ static int acpi_cpufreq_target(struct cp
} else {
pr_debug("Already at target state (P%d)\n",
next_perf_state);
- goto out;
+ return 0;
}
}
@@ -456,8 +456,7 @@ static int acpi_cpufreq_target(struct cp
cmd.val = (u32) perf->states[next_perf_state].control;
break;
default:
- result = -ENODEV;
- goto out;
+ return -ENODEV;
}
/* cpufreq holds the hotplug lock, so we are safe from here on */
@@ -480,7 +479,6 @@ static int acpi_cpufreq_target(struct cp
if (!result)
perf->state = next_perf_state;
-out:
return result;
}
[toc] | [prev] | [next] | [standalone]
| From | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> |
|---|---|
| Date | 2016-02-26 00:50 +0100 |
| Subject | Re: [PATCH 2/2] cpufreq: acpi-cpufreq: Drop pointless label from acpi_cpufreq_target() |
| Message-ID | <r6dPs-2Ti-25@gated-at.bofh.it> |
| In reply to | #1343562 |
On Fri, 2016-02-26 at 00:03 +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> The "out" label at the final return statement in
> acpi_cpufreq_target()
> is totally pointless, so drop them and modify the code to return the
> right values immediately instead of jumping to it.
>
> No functional changes.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> ---
> drivers/cpufreq/acpi-cpufreq.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> Index: linux-pm/drivers/cpufreq/acpi-cpufreq.c
> ===================================================================
> --- linux-pm.orig/drivers/cpufreq/acpi-cpufreq.c
> +++ linux-pm/drivers/cpufreq/acpi-cpufreq.c
> @@ -434,7 +434,7 @@ static int acpi_cpufreq_target(struct cp
> } else {
> pr_debug("Already at target state (P%d)\n",
> next_perf_state);
> - goto out;
> + return 0;
> }
> }
>
> @@ -456,8 +456,7 @@ static int acpi_cpufreq_target(struct cp
> cmd.val = (u32) perf-
> >states[next_perf_state].control;
> break;
> default:
> - result = -ENODEV;
> - goto out;
> + return -ENODEV;
> }
>
> /* cpufreq holds the hotplug lock, so we are safe from here
> on */
> @@ -480,7 +479,6 @@ static int acpi_cpufreq_target(struct cp
> if (!result)
> perf->state = next_perf_state;
>
> -out:
> return result;
> }
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[toc] | [prev] | [next] | [standalone]
| From | "Rafael J. Wysocki" <rjw@rjwysocki.net> |
|---|---|
| Date | 2016-02-26 00:10 +0100 |
| Subject | [PATCH 1/2] cpufreq: Rearrange __cpufreq_driver_target() |
| Message-ID | <r6dcK-2Ch-11@gated-at.bofh.it> |
| In reply to | #1343561 |
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Drop a pointless label at a return statement from
__cpufreq_driver_target() and rearrange that function
to reduce the indentation level.
No intentional functional changes.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/cpufreq/cpufreq.c | 47 ++++++++++++++++++++--------------------------
1 file changed, 21 insertions(+), 26 deletions(-)
Index: linux-pm/drivers/cpufreq/cpufreq.c
===================================================================
--- linux-pm.orig/drivers/cpufreq/cpufreq.c
+++ linux-pm/drivers/cpufreq/cpufreq.c
@@ -1899,7 +1899,8 @@ int __cpufreq_driver_target(struct cpufr
unsigned int relation)
{
unsigned int old_target_freq = target_freq;
- int retval = -EINVAL;
+ struct cpufreq_frequency_table *freq_table;
+ int index, retval;
if (cpufreq_disabled())
return -ENODEV;
@@ -1926,34 +1927,28 @@ int __cpufreq_driver_target(struct cpufr
policy->restore_freq = policy->cur;
if (cpufreq_driver->target)
- retval = cpufreq_driver->target(policy, target_freq, relation);
- else if (cpufreq_driver->target_index) {
- struct cpufreq_frequency_table *freq_table;
- int index;
-
- freq_table = cpufreq_frequency_get_table(policy->cpu);
- if (unlikely(!freq_table)) {
- pr_err("%s: Unable to find freq_table\n", __func__);
- goto out;
- }
-
- retval = cpufreq_frequency_table_target(policy, freq_table,
- target_freq, relation, &index);
- if (unlikely(retval)) {
- pr_err("%s: Unable to find matching freq\n", __func__);
- goto out;
- }
-
- if (freq_table[index].frequency == policy->cur) {
- retval = 0;
- goto out;
- }
+ return cpufreq_driver->target(policy, target_freq, relation);
- retval = __target_index(policy, freq_table, index);
+ if (!cpufreq_driver->target_index)
+ return -EINVAL;
+
+ freq_table = cpufreq_frequency_get_table(policy->cpu);
+ if (unlikely(!freq_table)) {
+ pr_err("%s: Unable to find freq_table\n", __func__);
+ return -EINVAL;
+ }
+
+ retval = cpufreq_frequency_table_target(policy, freq_table, target_freq,
+ relation, &index);
+ if (unlikely(retval)) {
+ pr_err("%s: Unable to find matching freq\n", __func__);
+ return retval;
}
-out:
- return retval;
+ if (freq_table[index].frequency == policy->cur)
+ return 0;
+
+ return __target_index(policy, freq_table, index);
}
EXPORT_SYMBOL_GPL(__cpufreq_driver_target);
[toc] | [prev] | [next] | [standalone]
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2016-02-26 03:40 +0100 |
| Message-ID | <r6gtX-4Py-13@gated-at.bofh.it> |
| In reply to | #1343561 |
On 26-02-16, 00:01, Rafael J. Wysocki wrote: > Hi, > > Two cleanups removing pointless labels at return statements from the > core and the ACPI driver. > > On opt of the current linux-next branch of linux-pm.git. Acked-by: Viresh Kumar <viresh.kumar@linaro.org> -- viresh
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web