From nobody Fri Jul 29 18:47:36 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 4Lvc2c4VtCz4Y1Tn; Fri, 29 Jul 2022 18:47:36 +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 4Lvc2c3rhbz3pyF; Fri, 29 Jul 2022 18:47:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659120456; 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=Qw1KNf6t0N/8qIJ4YeKApel1pKqDvuGtAzjeVxJAg3U=; b=uzjn/rllE0WY72GBDXYJDd3yODnqO4mG8+i9MCeWtsnK9Odjyj5Cfg8EnP/bSqffkWIWmx g8LE6cQfwkgbBKO8Kb4Yd59FCbAGs42+FjiaLPpFKugSOMlLkc/IVg6DqC3fWWy1qAwO3k H8R6SmgXt/W4XE9Zlxj4Vp3FkWf/HsX0mIX8UhSNRy0Gh9WFzq4QLViyefkg9tIxriVC88 1yDEMjsLv1dH0GAbKRwDSsJcTEVG6TjLEMXFoBq/zFfomSfsENgorFlXCM5EGo8/754080 ghaOKnUmeyrs5TjdGxZvewIef8nvvn6Gnb5pjWsJP5caLw2XQOkPmhCvjBZXlw== 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 4Lvc2c2pPDzm45; Fri, 29 Jul 2022 18:47:36 +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 26TIlaXE024320; Fri, 29 Jul 2022 18:47:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26TIlaXI024319; Fri, 29 Jul 2022 18:47:36 GMT (envelope-from git) Date: Fri, 29 Jul 2022 18:47:36 GMT Message-Id: <202207291847.26TIlaXI024319@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: 1fcaea242a7b - stable/13 - Fix unused variable warning in amd64's pmap.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: 1fcaea242a7b31eb6b449f00c98cb69faa156c12 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659120456; 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=Qw1KNf6t0N/8qIJ4YeKApel1pKqDvuGtAzjeVxJAg3U=; b=QUiQJy8y0rkXHwH3/bZTiYw72e22EpaSKal3LZhDS/PNvI0jorSaxn2F4DRS1zwFrYl4fB dKHOG3Z6wXJ6kipXO2Wqbft6NtN8EwyGmuI715YgIaIgZnM9sINq0vZtfh0DoyApR3ySZM jKG7IYs3mr6V2Vm0v/Bh92oDGb5Ooj25uyDuJCCuagHogjf6/gF1+lH5xanGcFoV4xAV7i P89hgYtP5GybyuMaptlhN6hrTIGMtorckqfc0Dh97igxCHYqwwOTDyk/4tZXiOOdlBE2W4 dKCw3TR6nZtzeWx3xhWo3L0mMUpuod3KwJxVSdX+kPIvibLQl6Hy1mO17hsBSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659120456; a=rsa-sha256; cv=none; b=Fj8ULBmkcXGZCPIV/ZFcPD73KzRRJXWcWYk1fHzmA6fR+ffCG7XwonAufnskUgWqq3oKkf nL8A0K7BeBn2IswE264vHy2kjVJnEDYtCn0hcmZfvPBQSvyBuoSdbVq4Vp/vIDLXfh+A1T jEUU13/viP6uv0g7Y1LnBdr+FaD8DspwbzW9Pf/mC8/OvLONUipCsX8Lt12Wsz/0x6MEau j2G7VKRlEeWfbLNBq1nwZ/Cythkm4bMsGy3NTNv+DBzXlOh/Uzy1A72bCCq/kyncC6k422 O8DSIMjtnJ78Go5Qk2Sq9BqqF2ohvs72JXqJDeCDjE+AXrbw2S9HQSxKrbeVNw== 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=1fcaea242a7b31eb6b449f00c98cb69faa156c12 commit 1fcaea242a7b31eb6b449f00c98cb69faa156c12 Author: Dimitry Andric AuthorDate: 2022-07-26 19:53:08 +0000 Commit: Dimitry Andric CommitDate: 2022-07-29 18:30:00 +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 (cherry picked from commit 7a1f289bd2949e5867c7f0396c35f02f179dc8bd) --- 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 79e61de490ae..5288cd7fbfef 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -8152,7 +8152,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; @@ -8186,7 +8189,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) { @@ -8307,7 +8312,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));