intel_cstates: Fix integer division inaccuracy

Integer division could have result in an out of bound substate.
This commit is contained in:
Pawel Dziepak 2014-01-21 04:18:20 +01:00
parent d01fa1ffe3
commit ae81c98aaf

View File

@ -83,7 +83,8 @@ cstates_idle(void)
ASSERT(state >= 0 && state < sCStateCount);
int subState = idleTime % timeStep;
subState /= timeStep / sCStates[state].fSubStatesCount;
subState *= sCStates[state].fSubStatesCount;
subState /= timeStep;
ASSERT(subState >= 0 && subState < sCStates[state].fSubStatesCount);