From nobody Tue Jul 26 20:10:03 2022 X-Original-To: dev-commits-src-main@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 4Lsp174JXlz4X2vp; Tue, 26 Jul 2022 20:10: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 4Lsp173fNJz3Kbd; Tue, 26 Jul 2022 20:10:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658866203; 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=T2toeeF2300/jGNycPFKr2ZFBM+H+7GpHXQ2srHpmcY=; b=hekeFU57iLgbRkAmRhDlkOC5T7vOOrdVs0MUiQVrM6/0Hx9vrAu6Na+CTT0xbLyKu3xguW Trs2ncMnzlXMqUV63Vzsh9NPVlkOFnvj+G7j/f8GBMuPV7FF+z8J4lLYavjAbMd5y6zLT0 VxPHXYt9an7XpwaMxmHTdxKUT8ELLZWruLKl+xw/w9u44kbQDDxmPdB+nPeus0nCU5Wpxp AVBTstcaK25FcFTEn2ZCrFQiEo9ISVWXer6nQv9Vf5m5byTCytjQhvqulsyG0oIEkF0yHD Kt/T/4XzjrRyglE77y5sdGnsJg9EViAIp6lsgzeGvp3hb6Tkgp54MJ4neszwvQ== 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 4Lsp172lp5zq53; Tue, 26 Jul 2022 20:10: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 26QKA3CJ078341; Tue, 26 Jul 2022 20:10:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26QKA3oG078338; Tue, 26 Jul 2022 20:10:03 GMT (envelope-from git) Date: Tue, 26 Jul 2022 20:10:03 GMT Message-Id: <202207262010.26QKA3oG078338@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: 7a1f289bd294 - main - Fix unused variable warning in amd64's pmap.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 7a1f289bd2949e5867c7f0396c35f02f179dc8bd Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658866203; 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=T2toeeF2300/jGNycPFKr2ZFBM+H+7GpHXQ2srHpmcY=; b=xYdT1Ei/n2RaReoJmVq/xlTD1N34kMq3OzD7ZwBIWvupWtTSayMWX5Kh1TTr5Ndt46xuws zTf9bElHoJxnOKkYOHk9DFc0FGr2UK/GQYVzyKmN6xfU7d4pEwK9aYTIkXFJIyuC2Zox0D tWeqqGO6Y7eMDKMW3vw+DES+RyT1avTxUlpaGYuPm8jX4a3lAqYS0aBPrAfX3YJxGzXpEq 9Urq82xWt9L7h/N9vDRqAryAT+CdXSJdPkLctqULlvdZGYw3feXETpUHgoexwZ39qvrGdP K06zcZVT/vVTCMwF/nrKQB4grdzTUz3WkCH7XXaFUaOmwbqkFohZorRHbncLHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658866203; a=rsa-sha256; cv=none; b=sfaRqU8JuwIapFJh6ocDRcFK9/WVPbiGJNZ+IRMZd25JC1R9/KzNLCNico4PloLjn/53Mn VcFWc/rnYwf2liX73cyCjs8x83I/elW6vAHvZ5gvXXYr0dP+KqWpRn2QaUEbtpxKm4hlUV AzRU6BNys+IRxXAZvQlL9l0R1CZJzT/7PcInjd6n6aUS5G8xP2FtpH8bzn7hAwjvbDiOuL HikOzMtdpqHxoTdVkLsetrDW2coqY8qWWr3n+T7tgVKHKwM0k3eMleW367L2sYe4EnqqXp ub5HTAqVdsw8Qg0zz9XDExC3eksc8B1ByOuJ3/Mabv9vS5yiZvw4AVz9gmZqvA== 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=7a1f289bd2949e5867c7f0396c35f02f179dc8bd commit 7a1f289bd2949e5867c7f0396c35f02f179dc8bd Author: Dimitry Andric AuthorDate: 2022-07-26 19:53:08 +0000 Commit: Dimitry Andric CommitDate: 2022-07-26 20:08:10 +0000 Fix unused variable warning in amd64's pmap.c With clang 15, the following -Werror warning is produced: sys/amd64/amd64/pmap.c:8274:22: error: variable 'freed' set but not used [-Werror,-Wunused-but-set-variable] int allfree, field, freed, i, idx; ^ The 'freed' variable is only used when PV_STATS is defined. Ensure it is only declared and set in that case. MFC after: 3 days --- sys/amd64/amd64/pmap.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index f35a8c4c789c..893774357629 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -8271,7 +8271,10 @@ pmap_remove_pages(pmap_t pmap) struct rwlock *lock; int64_t bit; uint64_t inuse, bitmask; - int allfree, field, freed, i, idx; + int allfree, field, i, idx; +#ifdef PV_STATS + int freed; +#endif boolean_t superpage; vm_paddr_t pa; @@ -8305,7 +8308,9 @@ pmap_remove_pages(pmap_t pmap) PMAP_LOCK(pmap); TAILQ_FOREACH_SAFE(pc, &pmap->pm_pvchunk, pc_list, npc) { allfree = 1; +#ifdef PV_STATS freed = 0; +#endif for (field = 0; field < _NPCM; field++) { inuse = ~pc->pc_map[field] & pc_freemask[field]; while (inuse != 0) { @@ -8426,7 +8431,9 @@ pmap_remove_pages(pmap_t pmap) } } pmap_unuse_pt(pmap, pv->pv_va, ptepde, &free); +#ifdef PV_STATS freed++; +#endif } } PV_STAT(counter_u64_add(pv_entry_frees, freed));