summaryrefslogtreecommitdiff
path: root/drivers/cpuidle/coupled.c
diff options
context:
space:
mode:
authorTuukka Tikkanen <tuukka.tikkanen@linaro.org>2013-08-14 16:02:41 (GMT)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-22 22:24:16 (GMT)
commit51f245b895e3fe4cbac0b2633e54a1830864a83f (patch)
tree15391fbf91a242be303522edb0642fb6ff130e19 /drivers/cpuidle/coupled.c
parentdecd51bbcd7fd949840da4cc634f6b70baa1b512 (diff)
downloadlinux-51f245b895e3fe4cbac0b2633e54a1830864a83f.tar.xz
cpuidle: Change struct menu_device field types
Field predicted_us value can never exceed expected_us value, but it has a potentially larger type. As there is no need for additional 32 bits of zeroes on 32 bit plaforms, change the type of predicted_us to match the type of expected_us. Field correction_factor is used to store a value that cannot exceed the product of RESOLUTION and DECAY (default 1024*8 = 8192). The constants cannot in practice be incremented to such values, that they'd overflow unsigned int even on 32 bit systems, so the type is changed to avoid unnecessary 64 bit arithmetic on 32 bit systems. One multiplication of (now) 32 bit values needs an added cast to avoid truncation of the result and has been added. In order to avoid another multiplication from 32 bit domain to 64 bit domain, the new correction_factor calculation has been changed from new = old * (DECAY-1) / DECAY to new = old - old / DECAY, which with infinite precision would yeild exactly the same result, but now changes the direction of rounding. The impact is not significant as the maximum accumulated difference cannot exceed the value of DECAY, which is relatively small compared to product of RESOLUTION and DECAY (8 / 8192). Signed-off-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpuidle/coupled.c')
0 files changed, 0 insertions, 0 deletions