diff mbox

[08/21] cpuidle: use cpuidle_disabled() instead of "off"

Message ID 19979ce88726285c72dd6fe3d7b370d53669443c.1379779777.git.viresh.kumar@linaro.org
State New
Headers show

Commit Message

Viresh Kumar Sept. 22, 2013, 1:21 a.m. UTC
We have a routine for getting value of "off", better call that instead of using
"off" directly.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpuidle/cpuidle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Lezcano Sept. 25, 2013, 9:52 p.m. UTC | #1
On 09/22/2013 03:21 AM, Viresh Kumar wrote:
> We have a routine for getting value of "off", better call that instead of using
> "off" directly.

We are in the fast path, I am not sure invoking a function here is
better than using directly the static variable.

> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  drivers/cpuidle/cpuidle.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> index 8c91bad..aec9029 100644
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -119,7 +119,7 @@ int cpuidle_idle_call(void)
>  	struct cpuidle_driver *drv;
>  	int next_state, entered_state;
>  
> -	if (off)
> +	if (cpuidle_disabled())
>  		return -ENODEV;
>  
>  	if (!initialized)
>
Viresh Kumar Sept. 26, 2013, 5:06 a.m. UTC | #2
On 26 September 2013 03:22, Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
> On 09/22/2013 03:21 AM, Viresh Kumar wrote:
>> We have a routine for getting value of "off", better call that instead of using
>> "off" directly.
>
> We are in the fast path, I am not sure invoking a function here is
> better than using directly the static variable.

I only did it for consistency as we have this routine specifically for reading
value of "off" and so we better don't use off directly..

Probably we can make it static inline and move it into
drivers/cpuidle/cpuidle.h?
Daniel Lezcano Sept. 26, 2013, 8:25 a.m. UTC | #3
On 09/26/2013 07:06 AM, Viresh Kumar wrote:
> On 26 September 2013 03:22, Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
>> On 09/22/2013 03:21 AM, Viresh Kumar wrote:
>>> We have a routine for getting value of "off", better call that instead of using
>>> "off" directly.
>>
>> We are in the fast path, I am not sure invoking a function here is
>> better than using directly the static variable.
>
> I only did it for consistency as we have this routine specifically for reading
> value of "off" and so we better don't use off directly..
>
> Probably we can make it static inline and move it into
> drivers/cpuidle/cpuidle.h?

If you move it to cpuidle.h, you will have to move the 'off' variable in 
the header hence increasing the scope of it.
diff mbox

Patch

diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index 8c91bad..aec9029 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -119,7 +119,7 @@  int cpuidle_idle_call(void)
 	struct cpuidle_driver *drv;
 	int next_state, entered_state;
 
-	if (off)
+	if (cpuidle_disabled())
 		return -ENODEV;
 
 	if (!initialized)