All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpufreq: Use list_is_last() to check last entry of the policy list
@ 2016-01-25  9:46 Gautham R. Shenoy
  2016-01-25  9:50 ` Viresh Kumar
  2016-01-27  6:32 ` [PATCH RESEND] " Gautham R. Shenoy
  0 siblings, 2 replies; 11+ messages in thread
From: Gautham R. Shenoy @ 2016-01-25  9:46 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar, linux-pm, linux-kernel
  Cc: Shilpasri G Bhat, Juri Lelli, Gautham R. Shenoy

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.

Cc: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
---
 drivers/cpufreq/cpufreq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 78b1e2f..b3059a3 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -67,11 +67,11 @@ static struct cpufreq_policy *next_policy(struct cpufreq_policy *policy,
 {
 	lockdep_assert_held(&cpufreq_driver_lock);
 	do {
-		policy = list_next_entry(policy, policy_list);
-
 		/* No more policies in the list */
-		if (&policy->policy_list == &cpufreq_policy_list)
+		if (list_is_last(&policy->policy_list, &cpufreq_policy_list))
 			return NULL;
+
+		policy = list_next_entry(policy, policy_list);
 	} while (!suitable_policy(policy, active));
 
 	return policy;
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] cpufreq: Use list_is_last() to check last entry of the policy list
  2016-01-25  9:46 [PATCH] cpufreq: Use list_is_last() to check last entry of the policy list Gautham R. Shenoy
@ 2016-01-25  9:50 ` Viresh Kumar
  2016-01-25 11:18   ` Juri Lelli
  2016-01-27  6:32 ` [PATCH RESEND] " Gautham R. Shenoy
  1 sibling, 1 reply; 11+ messages in thread
From: Viresh Kumar @ 2016-01-25  9:50 UTC (permalink / raw)
  To: Gautham R. Shenoy
  Cc: Rafael J. Wysocki, linux-pm, linux-kernel, Shilpasri G Bhat, Juri Lelli

On 25-01-16, 15:16, Gautham R. Shenoy wrote:
> 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.
> 
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
> ---
>  drivers/cpufreq/cpufreq.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 78b1e2f..b3059a3 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -67,11 +67,11 @@ static struct cpufreq_policy *next_policy(struct cpufreq_policy *policy,
>  {
>  	lockdep_assert_held(&cpufreq_driver_lock);
>  	do {
> -		policy = list_next_entry(policy, policy_list);
> -
>  		/* No more policies in the list */
> -		if (&policy->policy_list == &cpufreq_policy_list)
> +		if (list_is_last(&policy->policy_list, &cpufreq_policy_list))
>  			return NULL;
> +
> +		policy = list_next_entry(policy, policy_list);
>  	} while (!suitable_policy(policy, active));
>  
>  	return policy;

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] cpufreq: Use list_is_last() to check last entry of the policy list
  2016-01-25  9:50 ` Viresh Kumar
@ 2016-01-25 11:18   ` Juri Lelli
  2016-01-25 11:22     ` Viresh Kumar
  2016-01-27  6:09     ` Gautham R Shenoy
  0 siblings, 2 replies; 11+ messages in thread
From: Juri Lelli @ 2016-01-25 11:18 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Gautham R. Shenoy, Rafael J. Wysocki, linux-pm, linux-kernel,
	Shilpasri G Bhat

Hi,

On 25/01/16 15:20, Viresh Kumar wrote:
> On 25-01-16, 15:16, Gautham R. Shenoy wrote:
> > 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.
> > 
> > Cc: Viresh Kumar <viresh.kumar@linaro.org>
> > Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
> > ---
> >  drivers/cpufreq/cpufreq.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> > index 78b1e2f..b3059a3 100644
> > --- a/drivers/cpufreq/cpufreq.c
> > +++ b/drivers/cpufreq/cpufreq.c
> > @@ -67,11 +67,11 @@ static struct cpufreq_policy *next_policy(struct cpufreq_policy *policy,
> >  {
> >  	lockdep_assert_held(&cpufreq_driver_lock);

Which branch is this patch based on?

Thanks,

- Juri

> >  	do {
> > -		policy = list_next_entry(policy, policy_list);
> > -
> >  		/* No more policies in the list */
> > -		if (&policy->policy_list == &cpufreq_policy_list)
> > +		if (list_is_last(&policy->policy_list, &cpufreq_policy_list))
> >  			return NULL;
> > +
> > +		policy = list_next_entry(policy, policy_list);
> >  	} while (!suitable_policy(policy, active));
> >  
> >  	return policy;
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> 
> -- 
> viresh
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] cpufreq: Use list_is_last() to check last entry of the policy list
  2016-01-25 11:18   ` Juri Lelli
@ 2016-01-25 11:22     ` Viresh Kumar
  2016-01-27  5:57       ` Gautham R Shenoy
  2016-01-27  6:09     ` Gautham R Shenoy
  1 sibling, 1 reply; 11+ messages in thread
From: Viresh Kumar @ 2016-01-25 11:22 UTC (permalink / raw)
  To: Juri Lelli
  Cc: Gautham R. Shenoy, Rafael J. Wysocki, linux-pm, linux-kernel,
	Shilpasri G Bhat

On 25-01-16, 11:18, Juri Lelli wrote:
> Hi,
> 
> On 25/01/16 15:20, Viresh Kumar wrote:
> > On 25-01-16, 15:16, Gautham R. Shenoy wrote:
> > > 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.
> > > 
> > > Cc: Viresh Kumar <viresh.kumar@linaro.org>
> > > Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
> > > ---
> > >  drivers/cpufreq/cpufreq.c | 6 +++---
> > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> > > index 78b1e2f..b3059a3 100644
> > > --- a/drivers/cpufreq/cpufreq.c
> > > +++ b/drivers/cpufreq/cpufreq.c
> > > @@ -67,11 +67,11 @@ static struct cpufreq_policy *next_policy(struct cpufreq_policy *policy,
> > >  {
> > >  	lockdep_assert_held(&cpufreq_driver_lock);
> 
> Which branch is this patch based on?

Dude, what's going on here? How come you rebased on Juri's patches ?
:)

-- 
viresh

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] cpufreq: Use list_is_last() to check last entry of the policy list
  2016-01-25 11:22     ` Viresh Kumar
@ 2016-01-27  5:57       ` Gautham R Shenoy
  0 siblings, 0 replies; 11+ messages in thread
From: Gautham R Shenoy @ 2016-01-27  5:57 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Juri Lelli, Gautham R. Shenoy, Rafael J. Wysocki, linux-pm,
	linux-kernel, Shilpasri G Bhat

On Mon, Jan 25, 2016 at 04:52:15PM +0530, Viresh Kumar wrote:
> On 25-01-16, 11:18, Juri Lelli wrote:
> > Hi,
> > 
> > On 25/01/16 15:20, Viresh Kumar wrote:
> > > On 25-01-16, 15:16, Gautham R. Shenoy wrote:
> > > > 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.
> > > > 
> > > > Cc: Viresh Kumar <viresh.kumar@linaro.org>
> > > > Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
> > > > ---
> > > >  drivers/cpufreq/cpufreq.c | 6 +++---
> > > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > > > 
> > > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> > > > index 78b1e2f..b3059a3 100644
> > > > --- a/drivers/cpufreq/cpufreq.c
> > > > +++ b/drivers/cpufreq/cpufreq.c
> > > > @@ -67,11 +67,11 @@ static struct cpufreq_policy *next_policy(struct cpufreq_policy *policy,
> > > >  {
> > > >  	lockdep_assert_held(&cpufreq_driver_lock);
> > 
> > Which branch is this patch based on?
> 
> Dude, what's going on here? How come you rebased on Juri's patches ?
> :)

Ah right! I found this issue while reviewing Juri's patches from the
cpufreq-cleanups branch and didn't switch back to pm-next before
making this change. Shall resend the patch.

> 
> -- 
> viresh
> 

--
Thanks and Regards
gautham.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] cpufreq: Use list_is_last() to check last entry of the policy list
  2016-01-25 11:18   ` Juri Lelli
  2016-01-25 11:22     ` Viresh Kumar
@ 2016-01-27  6:09     ` Gautham R Shenoy
  2016-01-27 10:10       ` Juri Lelli
  1 sibling, 1 reply; 11+ messages in thread
From: Gautham R Shenoy @ 2016-01-27  6:09 UTC (permalink / raw)
  To: Juri Lelli
  Cc: Viresh Kumar, Gautham R. Shenoy, Rafael J. Wysocki, linux-pm,
	linux-kernel, Shilpasri G Bhat

On Mon, Jan 25, 2016 at 11:18:24AM +0000, Juri Lelli wrote:
> Hi,
> 
> On 25/01/16 15:20, Viresh Kumar wrote:
> > On 25-01-16, 15:16, Gautham R. Shenoy wrote:
> > > 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.
> > > 
> > > Cc: Viresh Kumar <viresh.kumar@linaro.org>
> > > Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
> > > ---
> > >  drivers/cpufreq/cpufreq.c | 6 +++---
> > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> > > index 78b1e2f..b3059a3 100644
> > > --- a/drivers/cpufreq/cpufreq.c
> > > +++ b/drivers/cpufreq/cpufreq.c
> > > @@ -67,11 +67,11 @@ static struct cpufreq_policy *next_policy(struct cpufreq_policy *policy,
> > >  {
> > >  	lockdep_assert_held(&cpufreq_driver_lock);
> 
> Which branch is this patch based on?

My bad! This is based on your branch  git://linux-arm.org/linux-jl.git
upstream/cpufreq_cleanups. I found this issue while reviewing your
cleanup patches.


> 
> Thanks,
> 
> - Juri

--
Thanks and Regards
gautham.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH RESEND] cpufreq: Use list_is_last() to check last entry of the policy list
  2016-01-25  9:46 [PATCH] cpufreq: Use list_is_last() to check last entry of the policy list Gautham R. Shenoy
  2016-01-25  9:50 ` Viresh Kumar
@ 2016-01-27  6:32 ` Gautham R. Shenoy
  2016-01-27  6:36   ` Viresh Kumar
  1 sibling, 1 reply; 11+ messages in thread
From: Gautham R. Shenoy @ 2016-01-27  6:32 UTC (permalink / raw)
  To: Viresh Kumar, linux-pm, linux-kernel, Rafael J. Wysocki
  Cc: Shilpasri G Bhat, Juri Lelli <Lelli, Gautham R. Shenoy

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.

Cc: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
---
The earlier version one was based on an Juri's experimental branch. 
I have based this one on linux-pm.git linux-next branch.

 drivers/cpufreq/cpufreq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index c35e7da..e979ec7 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,
 					  bool active)
 {
 	do {
-		policy = list_next_entry(policy, policy_list);
-
 		/* No more policies in the list */
-		if (&policy->policy_list == &cpufreq_policy_list)
+		if (list_is_last(&policy->policy_list, &cpufreq_policy_list))
 			return NULL;
+
+		policy = list_next_entry(policy, policy_list);
 	} while (!suitable_policy(policy, active));
 
 	return policy;
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH RESEND] cpufreq: Use list_is_last() to check last entry of the policy list
  2016-01-27  6:32 ` [PATCH RESEND] " Gautham R. Shenoy
@ 2016-01-27  6:36   ` Viresh Kumar
  2016-01-27 22:55     ` Rafael J. Wysocki
  0 siblings, 1 reply; 11+ messages in thread
From: Viresh Kumar @ 2016-01-27  6:36 UTC (permalink / raw)
  To: Gautham R. Shenoy
  Cc: linux-pm, linux-kernel, Rafael J. Wysocki, Shilpasri G Bhat,
	Juri Lelli <Lelli

On 27-01-16, 12:02, Gautham R. Shenoy wrote:
> 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.
> 
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
> ---
> The earlier version one was based on an Juri's experimental branch. 
> I have based this one on linux-pm.git linux-next branch.
> 
>  drivers/cpufreq/cpufreq.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index c35e7da..e979ec7 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,
>  					  bool active)
>  {
>  	do {
> -		policy = list_next_entry(policy, policy_list);
> -
>  		/* No more policies in the list */
> -		if (&policy->policy_list == &cpufreq_policy_list)
> +		if (list_is_last(&policy->policy_list, &cpufreq_policy_list))
>  			return NULL;
> +
> +		policy = list_next_entry(policy, policy_list);
>  	} while (!suitable_policy(policy, active));
>  
>  	return policy;

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] cpufreq: Use list_is_last() to check last entry of the policy list
  2016-01-27  6:09     ` Gautham R Shenoy
@ 2016-01-27 10:10       ` Juri Lelli
  2016-01-27 11:12         ` Gautham R Shenoy
  0 siblings, 1 reply; 11+ messages in thread
From: Juri Lelli @ 2016-01-27 10:10 UTC (permalink / raw)
  To: Gautham R Shenoy
  Cc: Viresh Kumar, Rafael J. Wysocki, linux-pm, linux-kernel,
	Shilpasri G Bhat

On 27/01/16 11:39, Gautham R Shenoy wrote:
> On Mon, Jan 25, 2016 at 11:18:24AM +0000, Juri Lelli wrote:
> > Hi,
> > 
> > On 25/01/16 15:20, Viresh Kumar wrote:
> > > On 25-01-16, 15:16, Gautham R. Shenoy wrote:
> > > > 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.
> > > > 
> > > > Cc: Viresh Kumar <viresh.kumar@linaro.org>
> > > > Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
> > > > ---
> > > >  drivers/cpufreq/cpufreq.c | 6 +++---
> > > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > > > 
> > > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> > > > index 78b1e2f..b3059a3 100644
> > > > --- a/drivers/cpufreq/cpufreq.c
> > > > +++ b/drivers/cpufreq/cpufreq.c
> > > > @@ -67,11 +67,11 @@ static struct cpufreq_policy *next_policy(struct cpufreq_policy *policy,
> > > >  {
> > > >  	lockdep_assert_held(&cpufreq_driver_lock);
> > 
> > Which branch is this patch based on?
> 
> My bad! This is based on your branch  git://linux-arm.org/linux-jl.git
> upstream/cpufreq_cleanups. I found this issue while reviewing your
> cleanup patches.
> 

No problem, and thanks for reviewing those! Any feedback? :)

Best,

- Juri

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] cpufreq: Use list_is_last() to check last entry of the policy list
  2016-01-27 10:10       ` Juri Lelli
@ 2016-01-27 11:12         ` Gautham R Shenoy
  0 siblings, 0 replies; 11+ messages in thread
From: Gautham R Shenoy @ 2016-01-27 11:12 UTC (permalink / raw)
  To: Juri Lelli
  Cc: Gautham R Shenoy, Viresh Kumar, Rafael J. Wysocki, linux-pm,
	linux-kernel, Shilpasri G Bhat

On Wed, Jan 27, 2016 at 10:10:20AM +0000, Juri Lelli wrote:
> On 27/01/16 11:39, Gautham R Shenoy wrote:
> > On Mon, Jan 25, 2016 at 11:18:24AM +0000, Juri Lelli wrote:
> > > Hi,
> > > 
> > > On 25/01/16 15:20, Viresh Kumar wrote:
> > > > On 25-01-16, 15:16, Gautham R. Shenoy wrote:
> > > > > 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.
> > > > > 
> > > > > Cc: Viresh Kumar <viresh.kumar@linaro.org>
> > > > > Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
> > > > > ---
> > > > >  drivers/cpufreq/cpufreq.c | 6 +++---
> > > > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > > > > 
> > > > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> > > > > index 78b1e2f..b3059a3 100644
> > > > > --- a/drivers/cpufreq/cpufreq.c
> > > > > +++ b/drivers/cpufreq/cpufreq.c
> > > > > @@ -67,11 +67,11 @@ static struct cpufreq_policy *next_policy(struct cpufreq_policy *policy,
> > > > >  {
> > > > >  	lockdep_assert_held(&cpufreq_driver_lock);
> > > 
> > > Which branch is this patch based on?
> > 
> > My bad! This is based on your branch  git://linux-arm.org/linux-jl.git
> > upstream/cpufreq_cleanups. I found this issue while reviewing your
> > cleanup patches.
> > 
> 
> No problem, and thanks for reviewing those! Any feedback? :)

It's a timely patchset! 

Off late on POWER systems we've been observing a lot of jitters due to
the on-demand worker thread periodically interrupting a running task
to monitor (not necessarily change if the task!) frequency. We would
very much like to see the frequency monitoring/change happen from an
the timer-context instead of waking up a separate worker thread,
something similar to CPUFREQ_DRIVER_FAST in sched_governor.  However,
that approach required a careful audit of all the locks that are
currently taken in cpufreq core and this patch set is a good attempt
in this direction.

Barring the issues raised by Viresh with respect to the locking
conventions around CPUFREQ_GOV_POLICY_EXIT, I didn't have any
particular issues with it.


> 
> Best,
> 
> - Juri
> 

--
Thanks and Regards
gautham.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH RESEND] cpufreq: Use list_is_last() to check last entry of the policy list
  2016-01-27  6:36   ` Viresh Kumar
@ 2016-01-27 22:55     ` Rafael J. Wysocki
  0 siblings, 0 replies; 11+ messages in thread
From: Rafael J. Wysocki @ 2016-01-27 22:55 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Gautham R. Shenoy, linux-pm, linux-kernel, Shilpasri G Bhat,
	Juri Lelli <Lelli

On Wednesday, January 27, 2016 12:06:11 PM Viresh Kumar wrote:
> On 27-01-16, 12:02, Gautham R. Shenoy wrote:
> > 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.
> > 
> > Cc: Viresh Kumar <viresh.kumar@linaro.org>
> > Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
> > ---
> > The earlier version one was based on an Juri's experimental branch. 
> > I have based this one on linux-pm.git linux-next branch.
> > 
> >  drivers/cpufreq/cpufreq.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> > index c35e7da..e979ec7 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,
> >  					  bool active)
> >  {
> >  	do {
> > -		policy = list_next_entry(policy, policy_list);
> > -
> >  		/* No more policies in the list */
> > -		if (&policy->policy_list == &cpufreq_policy_list)
> > +		if (list_is_last(&policy->policy_list, &cpufreq_policy_list))
> >  			return NULL;
> > +
> > +		policy = list_next_entry(policy, policy_list);
> >  	} while (!suitable_policy(policy, active));
> >  
> >  	return policy;
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Applied, thanks!

Rafael

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-01-27 22:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-25  9:46 [PATCH] cpufreq: Use list_is_last() to check last entry of the policy list Gautham R. Shenoy
2016-01-25  9:50 ` Viresh Kumar
2016-01-25 11:18   ` Juri Lelli
2016-01-25 11:22     ` Viresh Kumar
2016-01-27  5:57       ` Gautham R Shenoy
2016-01-27  6:09     ` Gautham R Shenoy
2016-01-27 10:10       ` Juri Lelli
2016-01-27 11:12         ` Gautham R Shenoy
2016-01-27  6:32 ` [PATCH RESEND] " Gautham R. Shenoy
2016-01-27  6:36   ` Viresh Kumar
2016-01-27 22:55     ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.