Date: Wed, 15 Dec 2021 11:16:41 GMT From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: ede576831b81 - main - rk_i2c_drain_rx: remove useless arithmetic manipulations Message-ID: <202112151116.1BFBGfjK081622@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=ede576831b818c78d23a9600932e13e47b8fd745 commit ede576831b818c78d23a9600932e13e47b8fd745 Author: Andriy Gapon <avg@FreeBSD.org> AuthorDate: 2021-12-15 08:42:23 +0000 Commit: Andriy Gapon <avg@FreeBSD.org> CommitDate: 2021-12-15 11:15:45 +0000 rk_i2c_drain_rx: remove useless arithmetic manipulations When i % 4 == 0 the result of (i / 4) * 4 is always i. MFC after: 1 week --- 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 18b7b2255e17..5ee1b8e96744 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202112151116.1BFBGfjK081622>