Re: [PATCH 4/6] cpufreq: Add a get_current_driver helper

From: Borislav Petkov
Date: Mon Jan 28 2013 - 04:46:56 EST


On Mon, Jan 28, 2013 at 10:07:10AM +0530, Viresh Kumar wrote:
> Two minor things here:
> - You placed the routine at bad place. This place is meant for
> freq_table helpers.

Which one would you suggest: CPUFREQ DRIVER INTERFACE?

Btw, this function type splitting looks kinda silly to me. In that same
section there are two which clearly don't belong there:

struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu);
void cpufreq_cpu_put(struct cpufreq_policy *data);

since they don't have anything to do with freq_table. And since they
return cpufreq_policy, they should be maybe called:

cpufreq_get_cpu_policy
cpufreq_put_cpu_policy

or something more expressive, pertaining to what they actually do. But
they actually get/put the module (inc/dec the module's refcount) *and*
return the cpufreq_policy... whatever, I don't care that much so see
below.

> - And you really don't need extern for function prototypes.

Yeah, Rafael corrected that when committing:

http://git.kernel.org/?p=linux/kernel/git/rafael/linux-pm.git;a=commitdiff;h=fcbf43dcacb0daecffca0f5c862c9d8815108e58

--