OSDN Git Service

media: i2c: max2175: use 64-bit arithmetic instead of 32-bit
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Tue, 6 Feb 2018 16:47:37 +0000 (11:47 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 26 Feb 2018 13:08:15 +0000 (08:08 -0500)
commita2603d1748fddaa44b70b027737ba077145f261c
treed2f6ca113bb90c39b2db24fb06c801d4799231c4
parent91e0c0c1b05230d703395965d4bf298705819641
media: i2c: max2175: use 64-bit arithmetic instead of 32-bit

Add suffix LL to constant 2 in order to give the compiler complete
information about the proper arithmetic to use. Notice that this
constant is used in a context that expects an expression of type
s64 (64 bits, signed).

The expression 2 * (clock_rate - abs_nco_freq) is currently being
evaluated using 32-bit arithmetic.

Addresses-Coverity-ID: 1446589 ("Unintentional integer overflow")

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/i2c/max2175.c