lkml.org 
[lkml]   [2013]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH V4 1/2] cpufreq: ondemand: allow custom powersave_bias_target handler to be registered
From
On 4 April 2013 21:49, Jacob Shin <jacob.shin@amd.com> wrote:
> diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c

> +static void od_set_powersave_bias(unsigned int powersave_bias)
> +{
> + unsigned int cpu;
> + struct od_dbs_tuners *od_tuners;
> +
> + if (!have_governor_per_policy()) {
> + od_tuners = od_dbs_cdata.gdbs_data->tuners;
> + od_tuners->powersave_bias = powersave_bias;
> + return;
> + }
> +
> + for_each_online_cpu(cpu) {
> + struct cpufreq_policy *policy;
> + struct dbs_data *dbs_data;
> + policy = per_cpu(od_cpu_dbs_info, cpu).cdbs.cur_policy;
> + dbs_data = policy->governor_data;
> + od_tuners = dbs_data->tuners;
> + od_tuners->powersave_bias = powersave_bias;
> + }

You can keep only the for_each_online_cpu() loop and remove the other
one. And in that one also, you don't have to do this for every cpu...

something like this will help you...

cpus_processed = NULL;

for_each_online_cpu(cpu) {
if cpu-is-present-in cpus_processed
continue;

cpu-set-mask(cpus_processed, policy->cpus);

}

Syntax is poor, please choose the correct one.

> +}


\
 
 \ /
  Last update: 2013-04-04 19:21    [W:0.084 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site