aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGautham R Shenoy <ego@linux.vnet.ibm.com>2016-01-27 01:32:26 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-01-27 17:13:59 -0500
commit2dadfd7564ef28391609c7ef896fd85218799012 (patch)
tree08dc2311bca1e793dc9fdb9c8d3a346348bf0e78
parente4b133cc4b30b48d488e4e4fffb132f173ce4358 (diff)
cpufreq: Use list_is_last() to check last entry of the policy list
Currently next_policy() explicitly checks if a policy is the last policy in the cpufreq_policy_list. Use the standard list_is_last primitive instead. Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/cpufreq/cpufreq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index c35e7da1ed7a..e979ec78b695 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -48,11 +48,11 @@ static struct cpufreq_policy *next_policy(struct cpufreq_policy *policy,
48 bool active) 48 bool active)
49{ 49{
50 do { 50 do {
51 policy = list_next_entry(policy, policy_list);
52
53 /* No more policies in the list */ 51 /* No more policies in the list */
54 if (&policy->policy_list == &cpufreq_policy_list) 52 if (list_is_last(&policy->policy_list, &cpufreq_policy_list))
55 return NULL; 53 return NULL;
54
55 policy = list_next_entry(policy, policy_list);
56 } while (!suitable_policy(policy, active)); 56 } while (!suitable_policy(policy, active));
57 57
58 return policy; 58 return policy;