git: 1da04ae8fb5b - main - rk_i2c: consistently treat booleans as such
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 15 Dec 2021 11:16:40 UTC
The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=1da04ae8fb5b7a1f1d9e52b87af1aaf756d28d4b commit 1da04ae8fb5b7a1f1d9e52b87af1aaf756d28d4b Author: Andriy Gapon <avg@FreeBSD.org> AuthorDate: 2021-12-15 08:40:22 +0000 Commit: Andriy Gapon <avg@FreeBSD.org> CommitDate: 2021-12-15 11:15:23 +0000 rk_i2c: consistently treat booleans as such MFC after: 1 week --- sys/arm64/rockchip/rk_i2c.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/arm64/rockchip/rk_i2c.c b/sys/arm64/rockchip/rk_i2c.c index 35257a2fe161..18b7b2255e17 100644 --- a/sys/arm64/rockchip/rk_i2c.c +++ b/sys/arm64/rockchip/rk_i2c.c @@ -304,9 +304,9 @@ rk_i2c_intr_locked(struct rk_i2c_softc *sc) if (sc->ipd & RK_I2C_IPD_NAKRCVIPD) { /* NACK received */ sc->ipd &= ~RK_I2C_IPD_NAKRCVIPD; - sc->nak_recv = 1; + sc->nak_recv = true; /* XXXX last byte !!!, signal error !!! */ - sc->transfer_done = 1; + sc->transfer_done = true; sc->state = STATE_IDLE; goto err; } @@ -546,14 +546,14 @@ rk_i2c_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) if (cold) { for(timeout = 10000; timeout > 0; timeout--) { rk_i2c_intr_locked(sc); - if (sc->transfer_done != 0) + if (sc->transfer_done) break; DELAY(1000); } if (timeout <= 0) err = IIC_ETIMEOUT; } else { - while (err == 0 && sc->transfer_done != 1) { + while (err == 0 && !sc->transfer_done) { err = msleep(sc, &sc->mtx, PZERO, "rk_i2c", 10 * hz); }