From 49d7072440ee9a48b03a7864a8b7f7721df5cd65 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Tue, 28 Apr 2015 12:52:05 +0100 Subject: [PATCH] Fix: cpuidle check directory name when numerating idle states Do not assume that all directories under cpuidle/ represent states; check that the directory name starts with "state" before trying to parse it. --- wlauto/modules/cpuidle.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wlauto/modules/cpuidle.py b/wlauto/modules/cpuidle.py index 9e0c6a1a..dca41553 100644 --- a/wlauto/modules/cpuidle.py +++ b/wlauto/modules/cpuidle.py @@ -98,7 +98,8 @@ class Cpuidle(Module): states_dir = self.device.path.join(self.device.path.dirname(self.root_path), cpu, 'cpuidle') idle_states = [] for state in self.device.listdir(states_dir): - idle_states.append(CpuidleState(self.device, self.device.path.join(states_dir, state))) + if state.startswith('state'): + idle_states.append(CpuidleState(self.device, self.device.path.join(states_dir, state))) return idle_states def _on_device_init(self, context): # pylint: disable=unused-argument