Skip to content

Commit

Permalink
cpufreq: remove redundant 'policy' field from user_policy
Browse files Browse the repository at this point in the history
Its always same as policy->policy, and there is no need to keep another
copy of it. Remove it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Viresh Kumar authored and Rafael J. Wysocki committed Sep 1, 2015
1 parent e27f8bd commit 88dc438
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
10 changes: 1 addition & 9 deletions drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,11 +671,7 @@ static ssize_t store_scaling_governor(struct cpufreq_policy *policy,
return -EINVAL;

ret = cpufreq_set_policy(policy, &new_policy);
if (ret)
return ret;

policy->user_policy.policy = policy->policy;
return count;
return ret ? ret : count;
}

/**
Expand Down Expand Up @@ -1322,9 +1318,6 @@ static int cpufreq_online(unsigned int cpu)
goto out_exit_policy;
}

if (new_policy)
policy->user_policy.policy = policy->policy;

up_write(&policy->rwsem);

kobject_uevent(&policy->kobj, KOBJ_ADD);
Expand Down Expand Up @@ -2302,7 +2295,6 @@ int cpufreq_update_policy(unsigned int cpu)
memcpy(&new_policy, policy, sizeof(*policy));
new_policy.min = policy->user_policy.min;
new_policy.max = policy->user_policy.max;
new_policy.policy = policy->user_policy.policy;

/*
* BIOS might change freq behind our back
Expand Down
1 change: 0 additions & 1 deletion include/linux/cpufreq.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ struct cpufreq_cpuinfo {
struct cpufreq_real_policy {
unsigned int min; /* in kHz */
unsigned int max; /* in kHz */
unsigned int policy; /* see above */
};

struct cpufreq_policy {
Expand Down

0 comments on commit 88dc438

Please sign in to comment.