thermal: armada: Fix possible overflow in the Armada 380 thermal sensor formula
authorNadav Haklai <nadavh@marvell.com>
Thu, 6 Aug 2015 16:03:49 +0000 (18:03 +0200)
committerEduardo Valentin <edubezval@gmail.com>
Fri, 30 Oct 2015 18:33:23 +0000 (11:33 -0700)
Update the coefficients so the calculation will not overrun the
unsigned long 32bits boundary

Signed-off-by: Nadav Haklai <nadavh@marvell.com>
Reviewed-by: Victor Axelrod <victora@marvell.com>
Reviewed-by: Neta Zur Hershkovits <neta@marvell.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/thermal/armada_thermal.c

index 26b8d326546a804d2c4f954258c0cc9839113d09..ae75328945f7b6e1818397d71b53f2c82e8473f9 100644 (file)
@@ -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,
 };