diff options
author | Rafael J. Wysocki | 2016-05-07 02:24:48 +0200 |
---|---|---|
committer | Rafael J. Wysocki | 2016-05-09 22:55:36 +0200 |
commit | f96fd0c86f081c27a0ba5efadfc13f612b4071d3 (patch) | |
tree | ef63eafe1a14361f16dbef94f7ff74c50dd44ba7 | |
parent | d87de8f38a6739ad180923dbefd3e08e087a8f51 (diff) |
intel_pstate: Clean up intel_pstate_get()
intel_pstate_get() contains a local variable that's initialized but
never used and it can be written in fewer lines of code, so clean
it up.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
-rw-r--r-- | drivers/cpufreq/intel_pstate.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 3addb22725e1..cde1a4ecaa6e 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -1404,14 +1404,9 @@ static int intel_pstate_init_cpu(unsigned int cpunum) static unsigned int intel_pstate_get(unsigned int cpu_num) { - struct sample *sample; - struct cpudata *cpu; + struct cpudata *cpu = all_cpu_data[cpu_num]; - cpu = all_cpu_data[cpu_num]; - if (!cpu) - return 0; - sample = &cpu->sample; - return get_avg_frequency(cpu); + return cpu ? get_avg_frequency(cpu) : 0; } static void intel_pstate_set_update_util_hook(unsigned int cpu_num) |