提交 f96fd0c8 编写于 作者: R Rafael J. Wysocki

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: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
上级 d87de8f3
...@@ -1404,14 +1404,9 @@ static int intel_pstate_init_cpu(unsigned int cpunum) ...@@ -1404,14 +1404,9 @@ static int intel_pstate_init_cpu(unsigned int cpunum)
static unsigned int intel_pstate_get(unsigned int cpu_num) static unsigned int intel_pstate_get(unsigned int cpu_num)
{ {
struct sample *sample; struct cpudata *cpu = all_cpu_data[cpu_num];
struct cpudata *cpu;
cpu = all_cpu_data[cpu_num]; return cpu ? get_avg_frequency(cpu) : 0;
if (!cpu)
return 0;
sample = &cpu->sample;
return get_avg_frequency(cpu);
} }
static void intel_pstate_set_update_util_hook(unsigned int cpu_num) static void intel_pstate_set_update_util_hook(unsigned int cpu_num)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册