Skip to content

Commit

Permalink
cpufreq: Drop redundant check for inactive policies
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Viresh Kumar authored and Rafael J. Wysocki committed Oct 14, 2015
1 parent 51ec005 commit e625742
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit e625742

Please sign in to comment.