cpuidle/coupled: Remove cpuidle_device::safe_state_index
authorXunlei Pang <pang.xunlei@linaro.org>
Tue, 4 Aug 2015 05:48:55 +0000 (13:48 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 28 Aug 2015 13:14:54 +0000 (15:14 +0200)
cpuidle_device::safe_state_index need to be initialized before
use, it should be the same as cpuidle_driver::safe_state_index.

We tackled this issue by removing the safe_state_index from the
cpuidle_device structure and use the one in the cpuidle_driver
structure instead.

Suggested-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpuidle/coupled.c
include/linux/cpuidle.h

index 7936dce4b8786f0ef00d2246a39d4d6692748e40..6493e4055abe3082dc88dca654cd8058aa455369 100644 (file)
@@ -473,7 +473,7 @@ int cpuidle_enter_state_coupled(struct cpuidle_device *dev,
                        return entered_state;
                }
                entered_state = cpuidle_enter_state(dev, drv,
-                       dev->safe_state_index);
+                       drv->safe_state_index);
                local_irq_disable();
        }
 
@@ -521,7 +521,7 @@ retry:
                }
 
                entered_state = cpuidle_enter_state(dev, drv,
-                       dev->safe_state_index);
+                       drv->safe_state_index);
                local_irq_disable();
        }
 
index d075d34279df3dbde3fadb6317ae403e9955f414..786ad32631a672695d88b47d67c1019df624acab 100644 (file)
@@ -84,7 +84,6 @@ struct cpuidle_device {
        struct list_head        device_list;
 
 #ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
-       int                     safe_state_index;
        cpumask_t               coupled_cpus;
        struct cpuidle_coupled  *coupled;
 #endif