diff options
| author | David Laight | 2025-11-19 22:41:16 +0000 |
|---|---|---|
| committer | Andi Shyti | 2026-01-20 14:14:36 +0100 |
| commit | fae88e03f45893cfb63c608761220a489cc6e25e (patch) | |
| tree | 72ae43d8292ba2ccdec503c38c96a51786ab169f /drivers/i2c | |
| parent | 949f647eff76a1e759af7b1c0295db5b5640928a (diff) | |
drivers/i2c/busses: use min() instead of min_t()
min_t(u8, a, b) casts both its arguments to u8 potentially discarding
signifinact bits.
Use min(a, b) instead as it cannot discard significant bits.
Detected by an extra check added to min_t().
Signed-off-by: David Laight <david.laight.linux@gmail.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20251119224140.8616-21-david.laight.linux@gmail.com
Diffstat (limited to 'drivers/i2c')
| -rw-r--r-- | drivers/i2c/busses/i2c-designware-master.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c index 15b3a46f0132..18f9a587732c 100644 --- a/drivers/i2c/busses/i2c-designware-master.c +++ b/drivers/i2c/busses/i2c-designware-master.c @@ -575,7 +575,7 @@ i2c_dw_recv_len(struct dw_i2c_dev *dev, u8 len) * after receiving the first byte. */ len += (flags & I2C_CLIENT_PEC) ? 2 : 1; - dev->tx_buf_len = len - min_t(u8, len, dev->rx_outstanding); + dev->tx_buf_len = len - min(len, dev->rx_outstanding); msgs[dev->msg_read_idx].len = len; msgs[dev->msg_read_idx].flags &= ~I2C_M_RECV_LEN; |
