diff options
author | Simran Singhal <singhalsimran0@gmail.com> | 2020-03-31 08:51:21 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2020-03-31 08:51:21 +0200 |
commit | 5af4698d98d881e786c0909b6308f04696586c49 (patch) | |
tree | d44b209233974f36d45dbad7d9cef7b91be830dc /xen/arch/x86/acpi/cpufreq/cpufreq.c | |
parent | 922f59a4302939471254b91c921daa5bd7c7e3fa (diff) |
x86: compress lines for immediate return
Compress two lines into a single line if immediate return statement is found.
It also remove variables retval, freq, effective, vector, ovf and now
as they are no longer needed.
Signed-off-by: Simran Singhal <singhalsimran0@gmail.com>
Reviewed-by: Wei Liu <wl@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Diffstat (limited to 'xen/arch/x86/acpi/cpufreq/cpufreq.c')
-rw-r--r-- | xen/arch/x86/acpi/cpufreq/cpufreq.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c index 281be131a3..f1f3c6923f 100644 --- a/xen/arch/x86/acpi/cpufreq/cpufreq.c +++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c @@ -270,7 +270,6 @@ unsigned int get_measured_perf(unsigned int cpu, unsigned int flag) struct cpufreq_policy *policy; struct perf_pair readin, cur, *saved; unsigned int perf_percent; - unsigned int retval; if (!cpu_online(cpu)) return 0; @@ -318,16 +317,13 @@ unsigned int get_measured_perf(unsigned int cpu, unsigned int flag) else perf_percent = 0; - retval = policy->cpuinfo.max_freq * perf_percent / 100; - - return retval; + return policy->cpuinfo.max_freq * perf_percent / 100; } static unsigned int get_cur_freq_on_cpu(unsigned int cpu) { struct cpufreq_policy *policy; struct acpi_cpufreq_data *data; - unsigned int freq; if (!cpu_online(cpu)) return 0; @@ -341,8 +337,7 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu) data->acpi_data == NULL || data->freq_table == NULL)) return 0; - freq = extract_freq(get_cur_val(cpumask_of(cpu)), data); - return freq; + return extract_freq(get_cur_val(cpumask_of(cpu)), data); } static void feature_detect(void *info) |