diff options
author | Wolfram Sang <wsa@kernel.org> | 2022-09-28 23:12:14 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2022-10-02 01:59:24 +0300 |
commit | 228336f50711e9f0f47352483a8501e0c598845b (patch) | |
tree | c39b810d25ab8c810a11ff83034d5b5e81ae61bc /drivers | |
parent | 492baeb958b1a94b8d52ec3960f82079ebbbebfb (diff) | |
download | linux-228336f50711e9f0f47352483a8501e0c598845b.tar.xz |
i2c: pci1xxxx: prevent signed integer overflow
Some constants need 'UL' markings, otherwise they are shifted into the
sign bit.
Fixes: 361693697249 ("i2c: microchip: pci1xxxx: Add driver for I2C host controller in multifunction endpoint of pci1xxxx switch")
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/busses/i2c-mchp-pci1xxxx.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-mchp-pci1xxxx.c b/drivers/i2c/busses/i2c-mchp-pci1xxxx.c index b2b7dbff5ef4..f5342201eb6b 100644 --- a/drivers/i2c/busses/i2c-mchp-pci1xxxx.c +++ b/drivers/i2c/busses/i2c-mchp-pci1xxxx.c @@ -190,9 +190,9 @@ * Bus Idle Minimum time = BUS_IDLE_MIN[7:0] x Baud_Clock_Period x * (BUS_IDLE_MIN_XK_TICKS[7] ? 4,1) */ -#define BUS_IDLE_MIN_100K_TICKS 167 -#define BUS_IDLE_MIN_400K_TICKS 139 -#define BUS_IDLE_MIN_1000K_TICKS 133 +#define BUS_IDLE_MIN_100K_TICKS 167UL +#define BUS_IDLE_MIN_400K_TICKS 139UL +#define BUS_IDLE_MIN_1000K_TICKS 133UL /* * CTRL_CUM_TIME_OUT_XK_TICKS defines SMBus Controller Cumulative Time-Out. |