diff mbox

[5/5] cpufreq: Drop redundant check for inactive policies

Message ID 2d6d59c2b0654872a32a9b63874b750e6b808cb5.1444583718.git.viresh.kumar@linaro.org
State New
Headers show

Commit Message

Viresh Kumar Oct. 11, 2015, 5:21 p.m. UTC
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>
---
 drivers/cpufreq/cpufreq.c | 7 -------
 1 file changed, 7 deletions(-)

Comments

Saravana Kannan Oct. 12, 2015, 7:35 p.m. UTC | #1
On 10/11/2015 10:21 AM, Viresh Kumar wrote:
> 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>
> ---
>   drivers/cpufreq/cpufreq.c | 7 -------
>   1 file changed, 7 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 58aabe0f2d2c..4fa2215cc6ec 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -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();
>

Doesn't really seem related to the sysfs reorg/clean up. Should it be a 
separate patch outside of this series?

Acked-by: Saravana Kannan <skannan@codeaurora.org>

-Saravana
Viresh Kumar Oct. 13, 2015, 6:05 a.m. UTC | #2
On 12-10-15, 12:35, Saravana Kannan wrote:
> Doesn't really seem related to the sysfs reorg/clean up. Should it
> be a separate patch outside of this series?

Sent it separately now ..

> Acked-by: Saravana Kannan <skannan@codeaurora.org>

A reviewed-by would have been more appropriate here though.
diff mbox

Patch

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 58aabe0f2d2c..4fa2215cc6ec 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -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();