cpuidle: menu: Avoid pointless checks in menu_select()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 15 Jan 2016 23:56:34 +0000 (00:56 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 19 Jan 2016 14:28:23 +0000 (15:28 +0100)
commit5bb1729cbdfbe974ad6385be94b14afbac97e19f
tree6a594c2ef4f971024f5b536c526f905a9d868f1a
parent51164251f5c35e6596130ef0de94ffe65fe441e0
cpuidle: menu: Avoid pointless checks in menu_select()

If menu_select() cannot find a suitable state to return, it will
return the state index stored in data->last_state_idx.  This
means that it is pointless to look at the states whose indices
are less than or equal to data->last_state_idx in the main loop,
so don't do that.

Given that those checks are done on every idle state selection, this
change can save quite a bit of completely unnecessary overhead.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/cpuidle/governors/menu.c