linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpudile: optimize cpuidle_enable_device error handling
@ 2017-09-01 15:07 gaurav jindal
  0 siblings, 0 replies; only message in thread
From: gaurav jindal @ 2017-09-01 15:07 UTC (permalink / raw)
  To: rjw, daniel.lezcano; +Cc: linux-pm, linux-kernel

do not fetch per cpu drv id cpuidle_curr_governor is NULL.
if cpuidle_enable_device is NULL return -EIO. it prevents
the addtional per cpu processing

Signed-off-by: Gaurav Jindal<gauravjindal1104@gmail.com>

---

diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index 1519716..6464e09 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -367,9 +367,12 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
 	if (dev->enabled)
 		return 0;

+	if (!cpuidle_curr_governor)
+		return -EIO;
+
 	drv = cpuidle_get_cpu_driver(dev);

-	if (!drv || !cpuidle_curr_governor)
+	if (!drv)
 		return -EIO;

 	if (!dev->registered)

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-09-01 15:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-01 15:07 [PATCH] cpudile: optimize cpuidle_enable_device error handling gaurav jindal

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).