Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Nadav Haklai and committed by
Eduardo Valentin
b56100db 84866ee5

+3 -3
+3 -3
drivers/thermal/armada_thermal.c
··· 224 224 .is_valid_shift = 10, 225 225 .temp_shift = 0, 226 226 .temp_mask = 0x3ff, 227 - .coef_b = 2931108200UL, 228 - .coef_m = 5000000UL, 229 - .coef_div = 10502, 227 + .coef_b = 1172499100UL, 228 + .coef_m = 2000096UL, 229 + .coef_div = 4201, 230 230 .inverted = true, 231 231 }; 232 232