Skip to content

Commit 228336f

Browse files
committed
i2c: pci1xxxx: prevent signed integer overflow
Some constants need 'UL' markings, otherwise they are shifted into the sign bit. Fixes: 3616936 ("i2c: microchip: pci1xxxx: Add driver for I2C host controller in multifunction endpoint of pci1xxxx switch") Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent 492baeb commit 228336f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/i2c/busses/i2c-mchp-pci1xxxx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@
190190
* Bus Idle Minimum time = BUS_IDLE_MIN[7:0] x Baud_Clock_Period x
191191
* (BUS_IDLE_MIN_XK_TICKS[7] ? 4,1)
192192
*/
193-
#define BUS_IDLE_MIN_100K_TICKS 167
194-
#define BUS_IDLE_MIN_400K_TICKS 139
195-
#define BUS_IDLE_MIN_1000K_TICKS 133
193+
#define BUS_IDLE_MIN_100K_TICKS 167UL
194+
#define BUS_IDLE_MIN_400K_TICKS 139UL
195+
#define BUS_IDLE_MIN_1000K_TICKS 133UL
196196

197197
/*
198198
* CTRL_CUM_TIME_OUT_XK_TICKS defines SMBus Controller Cumulative Time-Out.

0 commit comments

Comments
 (0)