cpufreq: Drop redundant check for inactive policies
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 13 Oct 2015 05:27:13 +0000 (10:57 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 14 Oct 2015 00:30:28 +0000 (02:30 +0200)
We just made sure policy->cpu is online and this check will always fail
as the policy is active. Drop it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Saravana Kannan <skannan@codeaurora.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c

index 25c4c15103a0cd8759e006eaa10d9f9edbfb5872..8701dc559850682b8fadef553487aeac21db4252 100644 (file)
@@ -843,18 +843,11 @@ static ssize_t store(struct kobject *kobj, struct attribute *attr,
 
        down_write(&policy->rwsem);
 
-       /* Updating inactive policies is invalid, so avoid doing that. */
-       if (unlikely(policy_is_inactive(policy))) {
-               ret = -EBUSY;
-               goto unlock_policy_rwsem;
-       }
-
        if (fattr->store)
                ret = fattr->store(policy, buf, count);
        else
                ret = -EIO;
 
-unlock_policy_rwsem:
        up_write(&policy->rwsem);
 unlock:
        put_online_cpus();