git: d655d4f1065e - stable/13 - rk_i2c_drain_rx: remove useless arithmetic manipulations
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 22 Dec 2021 06:51:27 UTC
The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=d655d4f1065e649f2aa748089849cf41a61de3b2 commit d655d4f1065e649f2aa748089849cf41a61de3b2 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:49:15 +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 50c968d687bd..026c731af4d4 100644 --- a/sys/arm64/rockchip/rk_i2c.c +++ b/sys/arm64/rockchip/rk_i2c.c @@ -265,7 +265,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;