From owner-svn-src-all@freebsd.org Mon Jul 16 01:07:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A31461033241; Mon, 16 Jul 2018 01:07:29 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A1167841B; Mon, 16 Jul 2018 01:07:29 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2063B159A7; Mon, 16 Jul 2018 01:07:29 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6G17SJf023128; Mon, 16 Jul 2018 01:07:28 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6G17SKC023127; Mon, 16 Jul 2018 01:07:28 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201807160107.w6G17SKC023127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 16 Jul 2018 01:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336325 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 336325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2018 01:07:29 -0000 Author: gonzo Date: Mon Jul 16 01:07:28 2018 New Revision: 336325 URL: https://svnweb.freebsd.org/changeset/base/336325 Log: Remove two checks that are always false Outer loop condition contradicts inner check so code under inner condition is not reachable. Remove it. PR: 229722 Reported by: David Binderman Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhost.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhost.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhost.c Mon Jul 16 00:28:33 2018 (r336324) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhost.c Mon Jul 16 01:07:28 2018 (r336325) @@ -1022,12 +1022,8 @@ bcm_sdhost_read_multi_4(device_t dev, struct sdhci_slo for (i = 0; i < count;) { edm = RD4(sc, HC_DEBUG); avail = ((edm >> 4) & 0x1f); - if (i + avail > count) { - if (i >= count) - return; - else - avail = count - i; - } + if (i + avail > count) + avail = count - i; if (avail > 0) bus_space_read_multi_4(sc->sc_bst, sc->sc_bsh, HC_DATAPORT, data + i, avail); @@ -1234,12 +1230,8 @@ bcm_sdhost_write_multi_4(device_t dev, struct sdhci_sl for (i = 0; i < count;) { edm = RD4(sc, HC_DEBUG); space = HC_FIFO_SIZE - ((edm >> 4) & 0x1f); - if (i + space > count) { - if (i >= count) - return; - else - space = count - i; - } + if (i + space > count) + space = count - i; if (space > 0) bus_space_write_multi_4(sc->sc_bst, sc->sc_bsh, HC_DATAPORT, data + i, space);