media: ts2020: avoid integer overflows on 32 bit machines
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 10 Jan 2018 12:20:39 +0000 (07:20 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Feb 2018 12:21:18 +0000 (13:21 +0100)
commitb2e7c63cad18341525643716bc62e5ac4ee50485
tree436b5a26f15f995277556fe23524d7a9daea2838
parentd1d85ae79d5e5592dccba6890658c0999b864ddc
media: ts2020: avoid integer overflows on 32 bit machines

commit 81742be14b6a90c9fd0ff6eb4218bdf696ad8e46 upstream.

Before this patch, when compiled for arm32, the signal strength
were reported as:

Lock   (0x1f) Signal= 4294908.66dBm C/N= 12.79dB

Because of a 32 bit integer overflow. After it, it is properly
reported as:

Lock   (0x1f) Signal= -58.64dBm C/N= 12.79dB

Fixes: 0f91c9d6bab9 ("[media] TS2020: Calculate tuner gain correctly")
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/dvb-frontends/ts2020.c