From owner-dev-commits-src-main@freebsd.org Wed Jan 13 11:31:25 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A70154D949E; Wed, 13 Jan 2021 11:31:25 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DG4yj4NNdz4X5b; Wed, 13 Jan 2021 11:31:25 +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 895D016C9C; Wed, 13 Jan 2021 11:31:25 +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 10DBVPdX048977; Wed, 13 Jan 2021 11:31:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10DBVPTk048976; Wed, 13 Jan 2021 11:31:25 GMT (envelope-from git) Date: Wed, 13 Jan 2021 11:31:25 GMT Message-Id: <202101131131.10DBVPTk048976@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: f2a7b434b30e - main - Variable declarations are since C99 and r363250 allowed inside for-loops. Partial revert of bafb68265672. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f2a7b434b30efe341d51c0c0b151614775771ab6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2021 11:31:25 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=f2a7b434b30efe341d51c0c0b151614775771ab6 commit f2a7b434b30efe341d51c0c0b151614775771ab6 Author: Hans Petter Selasky AuthorDate: 2021-01-13 11:27:04 +0000 Commit: Hans Petter Selasky CommitDate: 2021-01-13 11:30:41 +0000 Variable declarations are since C99 and r363250 allowed inside for-loops. Partial revert of bafb68265672. Suggested by: mmel@ --- sys/dev/gpio/gpioc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/dev/gpio/gpioc.c b/sys/dev/gpio/gpioc.c index 83d55742a3a2..9e46b32ffcba 100644 --- a/sys/dev/gpio/gpioc.c +++ b/sys/dev/gpio/gpioc.c @@ -567,7 +567,6 @@ gpioc_probe(device_t dev) static int gpioc_attach(device_t dev) { - int i; int err; struct gpioc_softc *sc; struct make_dev_args devargs; @@ -583,7 +582,7 @@ gpioc_attach(device_t dev) return (err); sc->sc_pin_intr = malloc(sizeof(struct gpioc_pin_intr) * sc->sc_npins, M_GPIOC, M_WAITOK | M_ZERO); - for (i = 0; i < sc->sc_npins; i++) { + for (int i = 0; i < sc->sc_npins; i++) { sc->sc_pin_intr[i].pin = malloc(sizeof(struct gpiobus_pin), M_GPIOC, M_WAITOK | M_ZERO); sc->sc_pin_intr[i].sc = sc; @@ -613,12 +612,11 @@ gpioc_detach(device_t dev) { struct gpioc_softc *sc = device_get_softc(dev); int err; - int i; if (sc->sc_ctl_dev) destroy_dev(sc->sc_ctl_dev); - for (i = 0; i < sc->sc_npins; i++) { + for (int i = 0; i < sc->sc_npins; i++) { mtx_destroy(&sc->sc_pin_intr[i].mtx); free(&sc->sc_pin_intr[i].pin, M_GPIOC); }