git: 55fb9062b73a - stable/12 - rk_i2c: consistently treat booleans as such

From: Andriy Gapon <avg_at_FreeBSD.org>
Date: Wed, 22 Dec 2021 06:59:16 UTC
The branch stable/12 has been updated by avg:

URL: https://cgit.FreeBSD.org/src/commit/?id=55fb9062b73a12d2e8bbfa2d3e35d6d12f3042bf

commit 55fb9062b73a12d2e8bbfa2d3e35d6d12f3042bf
Author:     Andriy Gapon <avg@FreeBSD.org>
AuthorDate: 2021-12-15 08:40:22 +0000
Commit:     Andriy Gapon <avg@FreeBSD.org>
CommitDate: 2021-12-22 06:57:04 +0000

    rk_i2c: consistently treat booleans as such
    
    (cherry picked from commit 1da04ae8fb5b7a1f1d9e52b87af1aaf756d28d4b)
---
 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 5bf37b906044..0b6bd9b1f9cf 100644
--- a/sys/arm64/rockchip/rk_i2c.c
+++ b/sys/arm64/rockchip/rk_i2c.c
@@ -305,9 +305,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;
 	}
@@ -525,14 +525,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);
 			}