Skip to content

Commit

Permalink
thermal: armada: Fix possible overflow in the Armada 380 thermal sens…
Browse files Browse the repository at this point in the history
…or 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>
  • Loading branch information
Nadav Haklai authored and Eduardo Valentin committed Oct 30, 2015
1 parent 84866ee commit b56100d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/thermal/armada_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down

0 comments on commit b56100d

Please sign in to comment.