Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Dec 2021 06:51:26 GMT
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 5bfa1a647667 - stable/13 - rk_i2c: consistently treat booleans as such
Message-ID:  <202112220651.1BM6pQLD035227@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by avg:

URL: https://cgit.FreeBSD.org/src/commit/?id=5bfa1a64766797572c3f07dee7ee339e3215eb7a

commit 5bfa1a64766797572c3f07dee7ee339e3215eb7a
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:49:15 +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 7b3ebb090fae..50c968d687bd 100644
--- a/sys/arm64/rockchip/rk_i2c.c
+++ b/sys/arm64/rockchip/rk_i2c.c
@@ -303,9 +303,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;
 	}
@@ -523,14 +523,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);
 			}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202112220651.1BM6pQLD035227>