linux/drivers/i2c/busses
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
..
i2c-acorn.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
i2c-ali15x3.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
i2c-ali1535.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
i2c-ali1563.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 428 2019-06-05 17:37:16 +02:00
i2c-altera.c i2c: altera: Fix potential integer overflow 2020-02-13 09:29:30 +01:00
i2c-amd756-s4882.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
i2c-amd756.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
i2c-amd8111.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 372 2019-06-05 17:37:10 +02:00
i2c-amd-mp2-pci.c drivers: Add generic helper to match any device 2019-07-30 13:07:42 +02:00
i2c-amd-mp2-plat.c i2c: Add drivers for the AMD PCIe MP2 I2C controller 2019-03-25 15:21:17 +01:00
i2c-amd-mp2.h i2c: Add drivers for the AMD PCIe MP2 I2C controller 2019-03-25 15:21:17 +01:00
i2c-aspeed.c Merge branch 'i2c/for-5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2019-12-01 18:29:36 -08:00
i2c-at91-core.c Merge branch 'i2c/for-current' into i2c/for-5.6 2020-01-15 18:31:37 +01:00
i2c-at91-master.c i2c: at91: Use dma_request_chan() directly for channel request 2019-11-14 21:41:03 +01:00
i2c-at91-slave.c i2c: at91: added slave mode support 2019-03-24 22:41:51 +01:00
i2c-at91.h i2c: at91: add support for analog filtering 2019-10-24 20:25:16 +02:00
i2c-au1550.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
i2c-axxia.c i2c: axxia: support slave mode 2019-08-29 21:07:30 +02:00
i2c-bcm2835.c i2c: bcm2835: Store pointer to bus clock 2020-01-06 15:51:11 +01:00
i2c-bcm-iproc.c i2c: iproc: Add i2c repeated start capability 2019-11-17 11:08:26 +01:00
i2c-bcm-kona.c
i2c-brcmstb.c i2c: brcmstb: remove unused struct member 2019-04-15 13:42:36 +02:00
i2c-cadence.c i2c: cadence: Fix wording in i2c-cadence driver 2020-01-30 09:23:17 +01:00
i2c-cbus-gpio.c i2c: cbus-gpio: Switch to use GPIO descriptors 2019-02-08 22:18:51 +01:00
i2c-cht-wc.c i2c: cht-wc: convert to use i2c_new_client_device() 2020-01-15 20:39:07 +01:00
i2c-cpm.c Merge branch 'i2c/for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2019-07-15 21:10:39 -07:00
i2c-cros-ec-tunnel.c i2c: cros-ec-tunnel: Fix ACPI identifier 2020-01-31 09:01:25 +01:00
i2c-davinci.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
i2c-designware-baytrail.c More ACPI updates for 4.20-rc1 2018-10-30 09:15:31 -07:00
i2c-designware-common.c i2c: designware: Add support for an interface clock 2019-03-20 17:57:18 +01:00
i2c-designware-core.h i2c: designware: Add support for an interface clock 2019-03-20 17:57:18 +01:00
i2c-designware-master.c i2c: designware: Fix unused variable warning 2019-08-06 22:23:24 +02:00
i2c-designware-pcidrv.c i2c: designware-pci: Add support for Elkhart Lake PSE I2C 2019-08-29 22:10:01 +02:00
i2c-designware-platdrv.c i2c: designware: Add ACPI HID for Hisilicon Hip08-Lite I2C controller 2020-02-03 12:03:18 +01:00
i2c-designware-slave.c i2c: designware: Synchronize IRQs when unregistering slave client 2019-08-29 20:47:42 +02:00
i2c-digicolor.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
i2c-diolan-u2c.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 372 2019-06-05 17:37:10 +02:00
i2c-dln2.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 372 2019-06-05 17:37:10 +02:00
i2c-efm32.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
i2c-eg20t.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 285 2019-06-05 17:36:37 +02:00
i2c-elektor.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
i2c-emev2.c i2c: emev2: avoid race when unregistering slave client 2019-08-14 14:49:43 +02:00
i2c-exynos5.c i2c: exynos5: Remove IRQF_ONESHOT 2019-09-04 23:13:16 +02:00
i2c-fsi.c i2c: fsi: Add of_put_node() before break 2019-09-03 20:33:43 +02:00
i2c-gpio.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
i2c-highlander.c Merge branch 'i2c/for-5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2020-02-07 12:54:13 -08:00
i2c-hix5hd2.c i2c: hix5hd2: Remove IRQF_ONESHOT 2019-09-03 20:01:13 +02:00
i2c-hydra.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
i2c-i801.c i2c: i801: Add support for Intel Comet Lake PCH-V 2020-01-29 22:06:01 +01:00
i2c-ibm_iic.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
i2c-ibm_iic.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
i2c-icy.c i2c: icy: convert to i2c_new_scanned_device 2019-11-28 17:15:48 +01:00
i2c-img-scb.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
i2c-imx-lpi2c.c i2c: imx-lpi2c: use devm_platform_ioremap_resource() to simplify code 2019-08-01 14:49:52 +02:00
i2c-imx.c Merge branch 'i2c/for-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2019-09-24 16:48:02 -07:00
i2c-iop3xx.c i2c: iop3xx: Fix memory leak in probe error path 2020-01-15 20:31:27 +01:00
i2c-iop3xx.h Merge branch 'i2c/for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2019-07-15 21:10:39 -07:00
i2c-isch.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
i2c-ismt.c i2c: ismt: Remove call to memset after dmam_alloc_coherent 2019-08-01 14:48:55 +02:00
i2c-jz4780.c i2c: jz4780: silence log flood on txabrt 2020-02-13 09:24:04 +01:00
i2c-kempld.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 294 2019-06-05 17:36:38 +02:00
i2c-lpc2k.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
i2c-meson.c i2c: meson: implement the master_xfer_atomic callback 2020-01-13 23:13:03 +01:00
i2c-mlxcpld.c i2c: mlxcpld: Fix wrong initialization order in probe 2019-05-27 21:24:58 +02:00
i2c-mpc.c i2c: mpc: always determine I2C clock prescaler at runtime 2018-01-15 19:19:55 +01:00
i2c-mt65xx.c i2c: mt65xx: fix NULL ptr dereference 2019-10-24 20:52:11 +02:00
i2c-mt7621.c i2c: mt7621: Fix platform_no_drv_owner.cocci warnings 2019-07-06 17:04:32 +02:00
i2c-mv64xxx.c treewide: remove redundant IS_ERR() before error code check 2020-02-04 03:05:27 +00:00
i2c-mxs.c i2c: mxs: use devm_platform_ioremap_resource() to simplify code 2019-08-01 14:49:36 +02:00
i2c-nforce2-s4985.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
i2c-nforce2.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
i2c-nomadik.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
i2c-nvidia-gpu.c i2c: nvidia-gpu: convert to use i2c_new_client_device() 2020-01-15 20:39:21 +01:00
i2c-ocores.c i2c: ocores: convert to use i2c_new_client_device() 2020-01-15 20:39:26 +01:00
i2c-octeon-core.c i2c: octeon: Prevent error message on bus error 2018-03-02 11:11:15 +01:00
i2c-octeon-core.h i2c: octeon: Prevent error message on bus error 2018-03-02 11:11:15 +01:00
i2c-octeon-platdrv.c i2c: busses: make i2c_adapter const 2017-08-29 22:26:08 +02:00
i2c-omap.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
i2c-opal.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 114 2019-05-24 17:39:01 +02:00
i2c-owl.c i2c: Add Actions Semiconductor Owl family S700 I2C support 2019-01-03 20:36:18 +01:00
i2c-parport.c i2c: parport: fix spelling mistake: "Atmost" -> "At most" 2020-01-29 21:51:49 +01:00
i2c-pasemi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
i2c-pca-isa.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
i2c-pca-platform.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
i2c-piix4.c Merge branch 'i2c/for-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2019-09-24 16:48:02 -07:00
i2c-pmcmsp.c Merge branch 'i2c/for-5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2020-02-07 12:54:13 -08:00
i2c-pnx.c i2c: pnx: Use proper printk format for resource_size_t 2020-01-15 21:10:40 +01:00
i2c-powermac.c i2c: powermac: convert to use i2c_new_client_device() 2020-01-15 20:39:35 +01:00
i2c-puv3.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
i2c-pxa-pci.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 462 2019-06-19 17:09:10 +02:00
i2c-pxa.c i2c: pxa: remove unused i2c-slave APIs 2019-11-11 21:38:09 +01:00
i2c-qcom-geni.c i2c: qcom-geni: Disable DMA processing on the Lenovo Yoga C630 2019-09-28 19:47:04 +02:00
i2c-qup.c i2c: qup: Use dma_request_chan() directly for channel request 2019-11-14 21:41:26 +01:00
i2c-rcar.c i2c: rcar: Remove superfluous call to clk_get_rate() 2019-11-14 21:31:39 +01:00
i2c-riic.c i2c: riic: Clear NACK in tend isr 2019-09-28 20:44:12 +02:00
i2c-rk3x.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
i2c-robotfuzz-osif.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 372 2019-06-05 17:37:10 +02:00
i2c-s3c2410.c i2c: s3c2410: Mark expected switch fall-through 2019-08-01 22:24:16 +02:00
i2c-scmi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 372 2019-06-05 17:37:10 +02:00
i2c-sh7760.c
i2c-sh_mobile.c i2c: sh_mobile: Use dma_request_chan() directly for channel request 2019-11-14 21:41:43 +01:00
i2c-sibyte.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
i2c-simtec.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 235 2019-06-19 17:09:07 +02:00
i2c-sirf.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 4 2019-05-21 11:28:40 +02:00
i2c-sis96x.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
i2c-sis630.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
i2c-sis5595.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
i2c-sprd.c i2c: sprd: Validate the return value of clock initialization 2019-08-06 22:54:23 +02:00
i2c-st.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
i2c-stm32.c i2c: stm32f7: report dma error during probe 2019-11-11 21:37:59 +01:00
i2c-stm32.h i2c: stm32: Use the correct style for SPDX License Identifier 2019-08-14 14:56:54 +02:00
i2c-stm32f4.c i2c-stm32f4: remove redundant initialization of pointer reg 2018-02-27 13:51:05 +01:00
i2c-stm32f7.c i2c: stm32f7: add PM_SLEEP suspend/resume support 2020-01-30 09:34:26 +01:00
i2c-stu300.c i2c: stu300: Use proper printk format for iomem pointer 2020-01-15 18:39:59 +01:00
i2c-sun6i-p2wi.c i2c: sun6i-pw2i: explicitly request exclusive reset control 2017-08-14 21:40:21 +02:00
i2c-synquacer.c treewide: remove redundant IS_ERR() before error code check 2020-02-04 03:05:27 +00:00
i2c-taos-evm.c i2c: taos-evm: convert to use i2c_new_client_device() 2020-01-15 20:39:41 +01:00
i2c-tegra-bpmp.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201 2019-05-30 11:29:52 -07:00
i2c-tegra.c i2c: tegra: Check DMA completion status in addition to left time 2020-01-15 18:32:37 +01:00
i2c-thunderx-pcidrv.c i2c: thunderx: Remove duplicate NULL check 2017-11-02 00:01:31 +01:00
i2c-tiny-usb.c i2c: tiny-usb: Correct I2C fault codes. 2020-01-06 15:40:43 +01:00
i2c-uniphier-f.c i2c: uniphier(-f): remove all dev_dbg() 2019-09-05 22:34:37 +02:00
i2c-uniphier.c i2c: uniphier(-f): remove all dev_dbg() 2019-09-05 22:34:37 +02:00
i2c-versatile.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
i2c-via.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
i2c-viapro.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
i2c-viperboard.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
i2c-wmt.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 75 2019-05-24 17:36:47 +02:00
i2c-xgene-slimpro.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
i2c-xiic.c i2c: xiic: fix indentation issue 2020-01-29 21:53:51 +01:00
i2c-xlp9xx.c i2c: xlp9xx: Fix case where SSIF read transaction completes early 2018-08-09 17:41:13 +02:00
i2c-xlr.c i2c: xlr: use core to detect 'no zero length' quirk 2018-08-04 23:25:08 +02:00
i2c-zx2967.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
Kconfig i2c: exynos: Update Kconfig documentation 2020-01-23 12:15:18 +01:00
Makefile i2c: parport-light: remove driver 2020-01-15 18:18:34 +01:00
scx200_acb.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00