From nobody Sun Jul 24 11:01:57 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 4LrKxd4fqxz4XXTc; Sun, 24 Jul 2022 11:01:57 +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 4LrKxd49XJz3bDN; Sun, 24 Jul 2022 11:01:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658660517; 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=WnVJjig9QsPJ5kXWbqtEdEPhBbPg6UxkvDDADCkk31A=; b=XJTdEvAwGhV8IyyQ5fdbMcoyr8pYj09XEVAdE5MUKMLeTb21FC1Vwe12Nhvdpg+Cj4l1GI 7h6V71hrEThgACFoud/SSrD8yUs6cbr5cTObdWLPPA5phUTADdYQzvoNd0Ik+rASN0SpSu JQXdheCUJLz5mlmpLkt6krM/fUoIo7jOMBlS+YTP/+sTB3zoHuTXRTbmpIasSJ668Qflwv Bk/SCWzeUf8nv+3iTDVfG7k7N+o56QjSJXhi7Cy5KzKt37WeT4H7D8UaMTu+CS2mPsozuU RD2YvL0EVgSHpKku2ZzU67kpeZCpPEum8fUYpFmFc5t+gnUGI5ZSwuCy4pCnwg== 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 4LrKxd3GPzzGng; Sun, 24 Jul 2022 11:01:57 +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 26OB1viK040974; Sun, 24 Jul 2022 11:01:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26OB1vdp040973; Sun, 24 Jul 2022 11:01:57 GMT (envelope-from git) Date: Sun, 24 Jul 2022 11:01:57 GMT Message-Id: <202207241101.26OB1vdp040973@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: ed4334af2457 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: ed4334af24570d0e6c2e106a89bd3d1cb353ca14 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658660517; 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=WnVJjig9QsPJ5kXWbqtEdEPhBbPg6UxkvDDADCkk31A=; b=Tg6oNd510q66hf5JWvBGNCM9sRnEopYq5kWawnyaviPihJrTilISfUD2kVD0SYz+n47ehG PzapCrR/PjQgwtZkyW9jSbNaPaclXbEJGay3kfOLdh1BX4dJ8FKvmUMRU2bEA7/qTisuKr UO7MImViyip8+MWq+GHEEfbdGBigQ7i28UDdKZXZ6G/E/ybEE6I5cIWxrEs/kPC+/IaRPi 0IMYt+SSpxbBK7fh2z3VpZOWPNSC8PB5sMX/+1qxiTsPSDma8q0eWiDLrlt2MOOLAMjuBi Sv0ZIq4Jcu7qD1JCfI66S9t3qdKtYCSQ0cykKgJtaFGfgDybYoU35Jlj+ORkOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658660517; a=rsa-sha256; cv=none; b=ssjKeKN9HNZnLd9/zE2Isni7jNKQwerEvQ4/eL3tvTkXxQaW3RSdUsTUrAFoEUZBw93wJ8 /3txIkv/bcdqbgxKe//CHj2kRGfxndYqmXARhsbZFxb6riFtqXtkW52aC0BK5m61aXMyXR hyNbvl6d7qQdx6dEnfgGP8DG3EV0P8ZB6rALsL0XLGE/8z8vTC9+ptymz8Qc+O9uAuqTcx j2ocQLzsbaVrH+7TwOfgv40qc9IdcTCHhzUmOz8w94HDumZEC/la354hrmRvQs2i19WPPr 7gy0x/+a5Rh0gRnVjEcSCKEZO8gL0GbUcFxKmP51AblSp4t6SMOXFYTXd89QEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=ed4334af24570d0e6c2e106a89bd3d1cb353ca14 commit ed4334af24570d0e6c2e106a89bd3d1cb353ca14 Author: Dimitry Andric AuthorDate: 2022-07-21 17:59:08 +0000 Commit: Dimitry Andric CommitDate: 2022-07-24 11:00:10 +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 (cherry picked from commit d7e0d962f39877b997454992a980f4122c6316e7) --- 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 634c78e6afe8..a77a653fe5d7 100644 --- a/sys/dev/firewire/fwohci.c +++ b/sys/dev/firewire/fwohci.c @@ -2741,7 +2741,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; @@ -2756,7 +2759,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); @@ -2922,7 +2927,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); @@ -2952,7 +2959,7 @@ out: } /* XXX make sure DMA is not dead */ } -#if 0 +#ifdef COUNT_PACKETS if (pcnt < 1) printf("fwohci_arcv: no packets\n"); #endif