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 <[email protected]>
Reviewed-by: Victor Axelrod <[email protected]>
Reviewed-by: Neta Zur Hershkovits <[email protected]>
Signed-off-by: Gregory CLEMENT <[email protected]>
Signed-off-by: Eduardo Valentin <[email protected]>
This commit is contained in:
Nadav Haklai 2015-08-06 18:03:49 +02:00 • committed by Eduardo Valentin
commit b56100db5b

View 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,
};