diff options
author | Nadav Haklai <nadavh@marvell.com> | 2015-08-06 18:03:49 +0200 |
---|---|---|
committer | Eduardo Valentin <edubezval@gmail.com> | 2015-10-30 11:33:23 -0700 |
commit | b56100db5b057fef889a73cb66c24633696d188b (patch) | |
tree | e2065f08beee5bac3da3d08b9599c387efc7a908 /drivers/thermal/armada_thermal.c | |
parent | 84866ee5818e95f6e97194656777c10ac24cb9d3 (diff) | |
download | op-kernel-dev-b56100db5b057fef889a73cb66c24633696d188b.zip op-kernel-dev-b56100db5b057fef889a73cb66c24633696d188b.tar.gz |
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 <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>
Diffstat (limited to 'drivers/thermal/armada_thermal.c')
-rw-r--r-- | drivers/thermal/armada_thermal.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c index 26b8d32..ae75328 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, }; |