* [PATCH] cpuidle/coupled: Init cpuidle_device::safe_state_index
@ 2015-07-23 12:31 Xunlei Pang
2015-08-03 16:22 ` Daniel Lezcano
0 siblings, 1 reply; 3+ messages in thread
From: Xunlei Pang @ 2015-07-23 12:31 UTC (permalink / raw)
To: linux-kernel; +Cc: Daniel Lezcano, Rafael J. Wysocki, linux-pm, Xunlei Pang
From: Xunlei Pang <pang.xunlei@zte.com.cn>
cpuidle_device::safe_state_index need to be initialized before use,
so assign the driver's safe_state_index to it.
Signed-off-by: Xunlei Pang <pang.xunlei@zte.com.cn>
---
drivers/cpuidle/cpuidle.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index e8e2775..ed5c8efe 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -585,6 +585,8 @@ int cpuidle_register(struct cpuidle_driver *drv,
*/
if (coupled_cpus)
device->coupled_cpus = *coupled_cpus;
+
+ device->safe_state_index = drv->safe_state_index;
#endif
ret = cpuidle_register_device(device);
if (!ret)
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] cpuidle/coupled: Init cpuidle_device::safe_state_index
2015-07-23 12:31 [PATCH] cpuidle/coupled: Init cpuidle_device::safe_state_index Xunlei Pang
@ 2015-08-03 16:22 ` Daniel Lezcano
2015-08-04 5:19 ` pang.xunlei
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Lezcano @ 2015-08-03 16:22 UTC (permalink / raw)
To: Xunlei Pang, linux-kernel; +Cc: Rafael J. Wysocki, linux-pm, Xunlei Pang
On 07/23/2015 02:31 PM, Xunlei Pang wrote:
> From: Xunlei Pang <pang.xunlei@zte.com.cn>
>
> cpuidle_device::safe_state_index need to be initialized before use,
> so assign the driver's safe_state_index to it.
>
> Signed-off-by: Xunlei Pang <pang.xunlei@zte.com.cn>
> ---
> drivers/cpuidle/cpuidle.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> index e8e2775..ed5c8efe 100644
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -585,6 +585,8 @@ int cpuidle_register(struct cpuidle_driver *drv,
> */
> if (coupled_cpus)
> device->coupled_cpus = *coupled_cpus;
> +
> + device->safe_state_index = drv->safe_state_index;
Hey, good catch. We are lucky the safe_state_index is always zero.
I think we can simplify the code by removing the safe_state_index from
the cpuidle_device structure and use the one in the cpuidle_driver
structure in coupled.c
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] cpuidle/coupled: Init cpuidle_device::safe_state_index
2015-08-03 16:22 ` Daniel Lezcano
@ 2015-08-04 5:19 ` pang.xunlei
0 siblings, 0 replies; 3+ messages in thread
From: pang.xunlei @ 2015-08-04 5:19 UTC (permalink / raw)
To: Daniel Lezcano
Cc: linux-kernel, linux-kernel-owner, linux-pm, Rafael J. Wysocki
Hi Daniel,
Daniel Lezcano <daniel.lezcano@linaro.org> wrote 2015-08-04 AM 12:22:54:
> Re: [PATCH] cpuidle/coupled: Init cpuidle_device::safe_state_index
>
> On 07/23/2015 02:31 PM, Xunlei Pang wrote:
> > From: Xunlei Pang <pang.xunlei@zte.com.cn>
> >
> > cpuidle_device::safe_state_index need to be initialized before use,
> > so assign the driver's safe_state_index to it.
> >
> > Signed-off-by: Xunlei Pang <pang.xunlei@zte.com.cn>
> > ---
> > drivers/cpuidle/cpuidle.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> > index e8e2775..ed5c8efe 100644
> > --- a/drivers/cpuidle/cpuidle.c
> > +++ b/drivers/cpuidle/cpuidle.c
> > @@ -585,6 +585,8 @@ int cpuidle_register(struct cpuidle_driver *drv,
> > */
> > if (coupled_cpus)
> > device->coupled_cpus = *coupled_cpus;
> > +
> > + device->safe_state_index = drv->safe_state_index;
>
> Hey, good catch. We are lucky the safe_state_index is always zero.
>
> I think we can simplify the code by removing the safe_state_index from
> the cpuidle_device structure and use the one in the cpuidle_driver
> structure in coupled.c
Will do, thanks!
Regards,
-Xunlei
--------------------------------------------------------
ZTE Information Security Notice: The information contained in this mail (and any attachment transmitted herewith) is privileged and confidential and is intended for the exclusive use of the addressee(s). If you are not an intended recipient, any disclosure, reproduction, distribution or other dissemination or use of the information contained is strictly prohibited. If you have received this mail in error, please delete it and notify us immediately.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-08-04 5:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-23 12:31 [PATCH] cpuidle/coupled: Init cpuidle_device::safe_state_index Xunlei Pang
2015-08-03 16:22 ` Daniel Lezcano
2015-08-04 5:19 ` pang.xunlei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).