From: Javi Merino Date: Sat, 2 May 2015 09:15:24 +0000 (+0100) Subject: thermal: power_allocator: round the division when divvying up power X-Git-Tag: omap-for-v4.3/legacy-v2-signed~141^2^2^2~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea54cac9065112724f3432e0574ba3e346fd695d;p=pandora-kernel.git thermal: power_allocator: round the division when divvying up power In situations where there is an uneven number of cooling devices, the division of power among them can lead to a milliwatt being dropped on the floor due to rounding errors. This doesn't sound like a lot, but some devices only grant the lowest cooling device state for their maximum power. So for instance, if the granted_power is the maximum power and all devices are getting their maximum power, one would get max_power - 1, making it choose cooling device state 1, instead of 0. Round the division to make the calculation more accurate. Cc: Zhang Rui Cc: Eduardo Valentin Signed-off-by: Javi Merino Signed-off-by: Eduardo Valentin --- Reading git-diff-tree failed