From nobody Wed Dec 22 06:59:16 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 09B9D18FA6D2; Wed, 22 Dec 2021 06:59:18 +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 4JJkhN6rgVz3PDJ; Wed, 22 Dec 2021 06:59:16 +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 B9C5A18E8D; Wed, 22 Dec 2021 06:59:16 +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 1BM6xGVP036837; Wed, 22 Dec 2021 06:59:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BM6xGXd036835; Wed, 22 Dec 2021 06:59:16 GMT (envelope-from git) Date: Wed, 22 Dec 2021 06:59:16 GMT Message-Id: <202112220659.1BM6xGXd036835@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 55fb9062b73a - stable/12 - 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 55fb9062b73a12d2e8bbfa2d3e35d6d12f3042bf Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640156357; 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=rqVT0zMi56aBQLcs+XHcQKl1ihQD+JZj/ZQkwnqXh5s=; b=rrCXoVOB1DvxqlDMcki9K50rcJIylkHwxOSR1qjsdi6UEloIqDZsKgnUNN3lSYdzxHALBm mGflbgdjr0uNTEhKUbhbqznFmDOLpmIrT6LbNb5UPg7m1iEvzqRnrVeGfX14FQn1ngPae7 SwZhaXqUy6WrapL6Cbhe2PF5I2KgFhec5rm5lQsbhhQdQy3qGMQsfoWeVNhHXEXEji/rEB ynCzh/OHTaIOXYunC3rv7G3K0ZhUax2sRK1g8KWb5HCzs+F+wn0KYCH6OUUqGkzOGipkuS IjLlX/x7TywlA3YaGYhkWU6slzh5DbVQg8NqL9+89xQ1lflbno2CJE64PDtvNg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640156357; a=rsa-sha256; cv=none; b=iV+B6TkaDad4ozLveoxhMYaTXuSmbVDpeX+x822Rampi/iiDDsjuJ7DHDaCO2GlnEE48KM Ug235zKjqGzwQPVLAWldUCKRAurkG1DB16yr5uitGCW3EEQsVMHaIH/rfEYYSmuo+LSjmj VRDblntU7Ldnq7cg1txHC950mzf3cfmdCqRToL8/nPjMm1jU5gYyBbgC9JF8m2Rop36fqD Zn1UQg988nIF7TAu6eJ4ldeokJ31PjlORjFvn0LLXJZt4SWpHKZbHo0YCbE6Cy01hF1WDP wGqWKsCj5Uw3psx7hfIIXKa01+JQCN+LEZzw6cWQulB3PkIO9Ry4sWuRlb6IFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=55fb9062b73a12d2e8bbfa2d3e35d6d12f3042bf commit 55fb9062b73a12d2e8bbfa2d3e35d6d12f3042bf Author: Andriy Gapon AuthorDate: 2021-12-15 08:40:22 +0000 Commit: Andriy Gapon 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); }