From: Nadav Haklai Date: Thu, 6 Aug 2015 16:03:49 +0000 (+0200) Subject: thermal: armada: Fix possible overflow in the Armada 380 thermal sensor formula X-Git-Tag: v4.4-rc1~38^2^3~1^2~1 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=b56100db5b057fef889a73cb66c24633696d188b;p=linux.git thermal: armada: Fix possible overflow in the Armada 380 thermal sensor formula Update the coefficients so the calculation will not overrun the unsigned long 32bits boundary Signed-off-by: Nadav Haklai Reviewed-by: Victor Axelrod Reviewed-by: Neta Zur Hershkovits Signed-off-by: Gregory CLEMENT Signed-off-by: Eduardo Valentin --- diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c index 26b8d326546a..ae75328945f7 100644 --- a/drivers/thermal/armada_thermal.c +++ b/drivers/thermal/armada_thermal.c @@ -224,9 +224,9 @@ static const struct armada_thermal_data armada380_data = { .is_valid_shift = 10, .temp_shift = 0, .temp_mask = 0x3ff, - .coef_b = 2931108200UL, - .coef_m = 5000000UL, - .coef_div = 10502, + .coef_b = 1172499100UL, + .coef_m = 2000096UL, + .coef_div = 4201, .inverted = true, };