git: 1c643b721bed - main - Fix a set but not used warning in the arm64 pmap

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Fri, 10 Dec 2021 12:11:04 UTC
The branch main has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=1c643b721bed48ba795b42cdc5e8b5818f30ed14

commit 1c643b721bed48ba795b42cdc5e8b5818f30ed14
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2021-12-07 14:32:11 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2021-12-10 12:10:30 +0000

    Fix a set but not used warning in the arm64 pmap
    
    In pmap_ts_referenced we read the virtual address from pv->pv_va,
    but then continue to use the pv struct to get the same value later
    in the function.
    
    Use the virtual address value we initially read rather than loading
    from the pv struct each time.
---
 sys/arm64/arm64/pmap.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c
index e732afc7e350..7763e1eabdda 100644
--- a/sys/arm64/arm64/pmap.c
+++ b/sys/arm64/arm64/pmap.c
@@ -5391,14 +5391,14 @@ retry:
 			}
 		}
 		va = pv->pv_va;
-		pde = pmap_pde(pmap, pv->pv_va, &lvl);
+		pde = pmap_pde(pmap, va, &lvl);
 		KASSERT(pde != NULL, ("pmap_ts_referenced: no l1 table found"));
 		KASSERT(lvl == 1,
 		    ("pmap_ts_referenced: invalid pde level %d", lvl));
 		tpde = pmap_load(pde);
 		KASSERT((tpde & ATTR_DESCR_MASK) == L1_TABLE,
 		    ("pmap_ts_referenced: found an invalid l1 table"));
-		pte = pmap_l1_to_l2(pde, pv->pv_va);
+		pte = pmap_l1_to_l2(pde, va);
 		tpte = pmap_load(pte);
 		if (pmap_pte_dirty(pmap, tpte)) {
 			/*
@@ -5428,11 +5428,11 @@ retry:
 			 * since the superpage is wired, the current state of
 			 * its reference bit won't affect page replacement.
 			 */
-			if ((((pa >> PAGE_SHIFT) ^ (pv->pv_va >> L2_SHIFT) ^
+			if ((((pa >> PAGE_SHIFT) ^ (va >> L2_SHIFT) ^
 			    (uintptr_t)pmap) & (Ln_ENTRIES - 1)) == 0 &&
 			    (tpte & ATTR_SW_WIRED) == 0) {
 				pmap_clear_bits(pte, ATTR_AF);
-				pmap_invalidate_page(pmap, pv->pv_va);
+				pmap_invalidate_page(pmap, va);
 				cleared++;
 			} else
 				not_cleared++;