kernel_optimize_test/drivers/i2c
Gustavo A. R. Silva 54498e8070 i2c: altera: Fix potential integer overflow
Factor out 100 from the equation and do 32-bit arithmetic (3 * clk_mhz / 10)
instead of 64-bit.

Notice that clk_mhz is MHz, so the multiplication will never wrap 32 bits
and there is no need for div_u64().

Addresses-Coverity: 1458369 ("Unintentional integer overflow")
Fixes: 0560ad5762 ("i2c: altera: Add Altera I2C Controller driver")
Suggested-by: David Laight <David.Laight@ACULAB.COM>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Thor Thayer <thor.thayer@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2020-02-13 09:29:30 +01:00
..
algos
busses i2c: altera: Fix potential integer overflow 2020-02-13 09:29:30 +01:00
muxes i2c: mux: pca954x: support property idle-state 2020-01-03 15:00:53 +01:00
i2c-boardinfo.c
i2c-core-acpi.c i2c: i2c-core-acpi: convert to use i2c_new_client_device() 2020-01-15 20:39:55 +01:00
i2c-core-base.c i2c: i2c-core-base: convert to use i2c_new_client_device() 2020-01-15 20:40:08 +01:00
i2c-core-of.c i2c: i2c-core-of: convert to use i2c_new_client_device() 2020-01-15 20:40:12 +01:00
i2c-core-slave.c
i2c-core-smbus.c
i2c-core.h
i2c-dev.c
i2c-mux.c
i2c-slave-eeprom.c
i2c-smbus.c
i2c-stub.c
Kconfig
Makefile