git: 5a75c18ead97 - stable/12 - rk_i2c_drain_rx: remove useless arithmetic manipulations
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 22 Dec 2021 06:59:17 UTC
The branch stable/12 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=5a75c18ead9726ef9a669d38073edf1346f632ba commit 5a75c18ead9726ef9a669d38073edf1346f632ba Author: Andriy Gapon <avg@FreeBSD.org> AuthorDate: 2021-12-15 08:42:23 +0000 Commit: Andriy Gapon <avg@FreeBSD.org> CommitDate: 2021-12-22 06:57:07 +0000 rk_i2c_drain_rx: remove useless arithmetic manipulations When i % 4 == 0 the result of (i / 4) * 4 is always i. (cherry picked from commit ede576831b818c78d23a9600932e13e47b8fd745) --- sys/arm64/rockchip/rk_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/rockchip/rk_i2c.c b/sys/arm64/rockchip/rk_i2c.c index 0b6bd9b1f9cf..35f7cd8a66e5 100644 --- a/sys/arm64/rockchip/rk_i2c.c +++ b/sys/arm64/rockchip/rk_i2c.c @@ -267,7 +267,7 @@ rk_i2c_drain_rx(struct rk_i2c_softc *sc) for (i = 0; i < len; i++) { if (i % 4 == 0) - buf32 = RK_I2C_READ(sc, RK_I2C_RXDATA_BASE + (i / 4) * 4); + buf32 = RK_I2C_READ(sc, RK_I2C_RXDATA_BASE + i); buf8 = (buf32 >> ((i % 4) * 8)) & 0xFF; sc->msg->buf[sc->cnt++] = buf8;