summaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorTuukka Tikkanen <tuukka.tikkanen@linaro.org>2013-08-14 19:02:41 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-23 00:24:16 +0200
commit51f245b895e3fe4cbac0b2633e54a1830864a83f (patch)
tree15391fbf91a242be303522edb0642fb6ff130e19 /arch/sh
parentdecd51bbcd7fd949840da4cc634f6b70baa1b512 (diff)
downloadblackbird-op-linux-51f245b895e3fe4cbac0b2633e54a1830864a83f.tar.gz
blackbird-op-linux-51f245b895e3fe4cbac0b2633e54a1830864a83f.zip
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 'arch/sh')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud