From nobody Thu Jul 21 19:06:03 2022 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 4Lphqb4llcz4XJnC; Thu, 21 Jul 2022 19:06:03 +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 4Lphqb4Dy8z3VCS; Thu, 21 Jul 2022 19:06:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658430363; 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=CDNEBbg/+WBT/JdcWWll45mxMWPK7gsyDsCLbEKU0Sg=; b=u+3E0FM0mwlv/c+IHGj+6H1k6jOIaoVK5a9kyaf8ZTmHZ361RST642/6pXGuc2zO4Iq8uR rKWoiUsdaOubGbSvZB5PvxMDYxuCzOuXUIsXzQASqTjRuyZzy8tj3CAiNwmq6ZiYQ64dGl o8wr2yMm1eN2mN3AczWoe7g7e1aQ3UYhUjkCV6cJvzANSyM3+za45D0WZU/+bqYX99QmKN besGsYrATpQM1DlkXgk8JElGIDFsFl2A9Y2TRdrKfvCNK2Z02H7Vb9ujjxbAEZTrgdEbNA 5PamxX7eFZBhElXhLv02xfgSr+GtQRo4//rZhanR2wKcV1a4PLdrHLEAHlBiDQ== 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 4Lphqb3HkjzYMW; Thu, 21 Jul 2022 19:06:03 +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 26LJ63cj038016; Thu, 21 Jul 2022 19:06:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26LJ63ei038015; Thu, 21 Jul 2022 19:06:03 GMT (envelope-from git) Date: Thu, 21 Jul 2022 19:06:03 GMT Message-Id: <202207211906.26LJ63ei038015@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: d7e0d962f398 - main - Fix unused variable warning in fwohci.c 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: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d7e0d962f39877b997454992a980f4122c6316e7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658430363; 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=CDNEBbg/+WBT/JdcWWll45mxMWPK7gsyDsCLbEKU0Sg=; b=wDixGyfOuVgtVtDHFzEhIkjvPPzXnocqI+bLZQ6ByIGhUWP71sKGLnO00+6FVQkOYFKyAN yM6ve3+zqhOPzygB+Lc368lh987skYmAcsv+mqSJVz8S2FQ5Jb+p1XUXniCCL+Tz7zjssj +NQHyz5NCTdHXNn8CIvOb3/1N/xtfihzGuWu+thKG/f0ZbVMJ7R9SooXm7JS5leW5U1Ra6 TgfrSmGWXzHQnb7bmlWq58gR/+Org+M+BwvOAFKV/v4/EGzSHAGQthd6Ne+tAnZeUDryK9 KD9XXuuIO27NHBk/Q54EeJHCungcE4KjxUgL/3R1E6O2DynbX6mb60qIkqM+Fg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658430363; a=rsa-sha256; cv=none; b=NoHGnlyFLqjzE6fO/7Pq+P8S+hFAo1LX4gBkNek7MMbKd8jgOFWUKfEs4OGQXFQRDd66X3 25XEovh774JsEYVoL8nCKaCOTsXKb2Yi+ZH4bkfgXWG/k2mStlLKndKnJHLTumoew7Wu1+ H/67qq9pyF0cqQWXrpXzbBm7mZnwJaoVMZnOva35cO+8C3kk97BLAP6+NT8C4sdzGlDGMv Hwhvwit19umQhOAoPD1b4M65ErTYXs2j3dWtcrnoPtVHS2bLBuBD29M0gcuHWvXv+nv3Wn pRLIu0LwGqJCQtqMBqQmftseKpz7cYo3JQPE3btq3MvMlbK3t/BwfkPNfNUTsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=d7e0d962f39877b997454992a980f4122c6316e7 commit d7e0d962f39877b997454992a980f4122c6316e7 Author: Dimitry Andric AuthorDate: 2022-07-21 17:59:08 +0000 Commit: Dimitry Andric CommitDate: 2022-07-21 19:05:50 +0000 Fix unused variable warning in fwohci.c With clang 15, the following -Werror warning is produced: sys/dev/firewire/fwohci.c:2762:23: error: variable 'pcnt' set but not used [-Werror,-Wunused-but-set-variable] int len, plen, hlen, pcnt, offset; ^ The 'pcnt' variable is eventually used only in an #if 0'd block, obviously meant for debugging. Ensure that 'pcnt' is only declared and used when COUNT_PACKETS is defined, so the debugging can be easily turned on later, if desired. MFC after: 3 days --- sys/dev/firewire/fwohci.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/dev/firewire/fwohci.c b/sys/dev/firewire/fwohci.c index 9c95bff21ccb..9c182c6fa331 100644 --- a/sys/dev/firewire/fwohci.c +++ b/sys/dev/firewire/fwohci.c @@ -2759,7 +2759,10 @@ fwohci_arcv(struct fwohci_softc *sc, struct fwohci_dbch *dbch, int count) uint8_t *ld; uint32_t stat, off, status, event; u_int spd; - int len, plen, hlen, pcnt, offset; +#ifdef COUNT_PACKETS + int pcnt; +#endif + int len, plen, hlen, offset; int s; caddr_t buf; int resCount; @@ -2774,7 +2777,9 @@ fwohci_arcv(struct fwohci_softc *sc, struct fwohci_dbch *dbch, int count) s = splfw(); db_tr = dbch->top; +#ifdef COUNT_PACKETS pcnt = 0; +#endif /* XXX we cannot handle a packet which lies in more than two buf */ fwdma_sync_multiseg_all(dbch->am, BUS_DMASYNC_POSTREAD); fwdma_sync_multiseg_all(dbch->am, BUS_DMASYNC_POSTWRITE); @@ -2940,7 +2945,9 @@ fwohci_arcv(struct fwohci_softc *sc, struct fwohci_dbch *dbch, int count) #endif break; } +#ifdef COUNT_PACKETS pcnt++; +#endif if (dbch->pdb_tr != NULL) { fwohci_arcv_free_buf(sc, dbch, dbch->pdb_tr, off, 1); @@ -2970,7 +2977,7 @@ out: } /* XXX make sure DMA is not dead */ } -#if 0 +#ifdef COUNT_PACKETS if (pcnt < 1) printf("fwohci_arcv: no packets\n"); #endif