git: ede576831b81 - main - rk_i2c_drain_rx: remove useless arithmetic manipulations

From: Andriy Gapon <avg_at_FreeBSD.org>
Date: Wed, 15 Dec 2021 11:16:41 UTC
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;