Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b56100db authored by Nadav Haklai's avatar Nadav Haklai Committed by Eduardo Valentin
Browse files

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: default avatarNadav Haklai <nadavh@marvell.com>
Reviewed-by: default avatarVictor Axelrod <victora@marvell.com>
Reviewed-by: default avatarNeta Zur Hershkovits <neta@marvell.com>
Signed-off-by: default avatarGregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
parent 84866ee5
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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,
};