From nobody Wed Dec 15 11:16:40 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 237E718E9872; Wed, 15 Dec 2021 11:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JDXkd0gxsz4r2B; Wed, 15 Dec 2021 11:16:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB5D51AF36; Wed, 15 Dec 2021 11:16:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BFBGeAe081599; Wed, 15 Dec 2021 11:16:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BFBGebo081598; Wed, 15 Dec 2021 11:16:40 GMT (envelope-from git) Date: Wed, 15 Dec 2021 11:16:40 GMT Message-Id: <202112151116.1BFBGebo081598@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andriy Gapon Subject: git: 1da04ae8fb5b - main - rk_i2c: consistently treat booleans as such List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1da04ae8fb5b7a1f1d9e52b87af1aaf756d28d4b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639567001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hSXoeSy9FAh1UCWoE++M2fYowtwZ1WQwpQcrCpakGeU=; b=OvoyzUoXaSTWyy6f39yH03d3eQOKcBHNDKbBa3f+/JtRB6zsj2L0WZYfJj+M8CKKxBetHq SK4p9Ia0CA465MHu4uuq2zo3JF8mu5unYombSngVBnua1gz202VhL9jN9o6RSKNLIz+1lR GfQ/jSGaIe4oVBCDrTQjJNUyH/NImEiIOs77GFT9Fm48uGZOJLbRSKOiqjpXfR8gAxRCME cVYiMyi4a+xWVLBoKwZTmDCabjxvn6FEUWSgVUbSScvae8fhmIBpojiVjmJTrLqjJSdJLx OASqQZhLTpke/l8+O4I61Yv6occGrnQGtKRdk8dM9xWHbcc2mqlbR7iE/nPVbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639567001; a=rsa-sha256; cv=none; b=YvV3KB9VubG1bRMkSZlT8USF6Nz2GSBFf2pF3RYWK4mexfTWCMSEnfTOWo1gk9K+7iDrwq SHR2YK/+ao7PwqK/WW9qvLqOq2o8d/DYenUk0DPRFmfcqE7i+UGklv+zHu0uOSAIe7WGvs ZGUWX3EzvZq9rTW27moTu+RkSd6AhP6iZvqTNhmXN7MPVJiEE8Lfm1sLC2m4HosJjmI0Cv ogyfHwIdw/BWEJU8AwjBoaiSBfN4/VtqwMm2/TBg1UM2Xyr3iAIolJv54r0R+Qrd6heZoU WyMUmapu8OnF+ABPPzM82a+8SUKvapQzaGvtGdYLtwaERgYVQiw5wLrbXJYCNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=1da04ae8fb5b7a1f1d9e52b87af1aaf756d28d4b commit 1da04ae8fb5b7a1f1d9e52b87af1aaf756d28d4b Author: Andriy Gapon AuthorDate: 2021-12-15 08:40:22 +0000 Commit: Andriy Gapon 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); }